Search:

Blog of Forest Johnson

This has officially deteriorated into the incoherent ramblings of a personal blog.

Wednesday, December 19, 2007

Messing around

Recently I've been taking a break from the racing game and off and on I did some micro projects that were interesting to me but hadn't had time to experiment with until now. Proof that I still have a hard time working on one project full on until its done. Anyway, here are the projects that a cool enough to be shown.

Volumetric Light / Audio visualizer / DWI file reader

This started out with me wanting to experiment with a volumetric light shader after talking to Nicholas long ago. The premise for the shader is that you render the depth of the front and back faces of the object separately, then subtract the depth of the front faces from the depth of the back faces pixel wise to get the volume in each pixel. I figured out a way to do it without resorting to Render Textures that should be fairly fast, but needs a property that isn't exposed in ShaderLab yet. So for now I faked it by baking the depth into a texture and slapping that on a camera facing plane. For the most part, you won't notice.

After I had modeled a quicky lamp using the tripod from the fps tutorial for attaching my light cone to, I had this wacky idea to time the lights to some music by using DDR stepfiles. (.dwi format which is "Dance With Intensity", not "Driving While Intoxicated") I was also thinking about audio visualizers at the time, which is one thing I have sort of always been interested in.

So I quickly slapped 4 rotating laser lamps into my test cave scene and got the work on playing back dwi files through the lights. The result shown here with DDR song ".59 (Tengoku)" is pretty impressive. Click on the screenshot to start a webplayer. (Be careful though, currently putting the browser window in the background or scrolling the browser window can cause the music and lights to become desynchronized)




Simple IK / Procedural animation

I also wanted to try making an IK system, with the greater goal of procedurally animated robots (Which is related to an old game idea I've always had). I made my job with the IK system a lot easier by requiring that the appendage have two joints that share the same or a mirrored axis, so that I can simply extend the appendage fully in the direction of the target point, then bend it back incrementally until it reaches the target.

I tried attaching a real physics joint rig that tries to follow the IK appendage and then driving the appendages attached to an object in a way that would suggest balancing, but mostly All I got was one or two very drunken stumbles. Next I tried the same but without joints and instead adding forces at the positions of the feet manually. That worked a little better, but still almost always failed within a few seconds. Finally I got something that resembles walking by faking the balance heavily and moving the legs just as a graphical effect. Here is the result of that:


4 comments:

ThirstyOnThursday said...

Wow! that's awesome, I love the four-legged one! I've recently been playing around with procedurally generated creatures (with the meshes and "limbs" generated from formulas, and then a generated skeleton based on those) but still can not get them to move realistically, they mostly end up with bouncing and jerky motions.
I'd be grateful if you could go into more detail on how you got it to work so convincingly.
Great blog!

Forest Johnson said...

Basically they float like hovercars, and the legs animate in a way that pretends to hold them up. It is pretty fake, but sometimes works... I recommend a somewhat different approach where the leg motions feed back into the floating motion somewhat. Also, step/ foot path planing is crucial because you can see that my robot's legs go through stuff a lot.

I may someday make a "What I actually did: walking robots" post along with the portals one.

ThirstyOnThursday said...

Ah, ok, thanks for your quick response.
Yeah, i'm sort of torn between the "accurate" and "faking it" methods of locomotion, since the benefit of my current procedural creatures is, since they "breed" (and i limit the "food" supply) I get really interesting competition/evolution of successful creatures, the problem is the "successful" ones end up spinning and flailing around, rather than actually walking... so I could fake it with premade legs, but then I remove the surprising "adaptations" that come from the "anything can happen" model.
That's a good idea though, treating the object as a hovercar, rather than actually supporting the body from the legs, as often I feel Unity's physics can be a bit out of whack (small collisions sometimes causing objects to fly up into the air or spin or jerk etc.)

If you do make such a post I'd definitely be interested and learn from it, but don't feel obligated :)

Anonymous said...

Yea, if you could go further into that subject (the robots walking and what were the effects of those experiments), that would be insanely great ;D.