Monday, December 3, 2007

Specular



This is...

Tuesday, November 13, 2007

Metronome



This is a visual metronome, sorta. The idea here is not to get a regular beat, but instead to eyeball visual smoothness. The orange ball should pass in smooth regular circles. If there's a background process or another application, like a webcam, that does something, like take a picture, once a second, this test will reveal that hiccup. Since there is so little going on in the movie, you then know that it's the system itself that is causing the hiccup as opposed to a coding issue.

Monday, October 22, 2007

Pathfinding



Testbed Author: Elia Morling, shailejron AT tildruin.com
Website: http://www.tildruin.com

For a movement control scheme, it's important for characters to not walk through solids. In a first person control scheme, this is done in a direct frame-by-frame way using collision detection. For 3rd person games with a point-and-click control scheme, movement is handled in a different way. When the user clicks a target location, a full path from the current location to the target location is calculated, and then the character moves step by step along that path unless a new target location is set.

The example above is a type of pathfinding called a-star. The idea is that there is an underlying grid laid out on the ground plane. Squares are marked as on or off limits. When the player clicks on a square, the player character calculates a path from the current position to the clicked position.

An added twist of a-star is that there is a "cost" associated with each potential path. This means that if there is more than one valid path, the costs can be compared to find the best path. This allows us to set a cost for each square rather then just setting each square as true/false for its passability. For example, road square can have a lower cost than default dirt squares. This gives nice results where characters will have a subtle preferences for roads versus a slightly shorter path that goes off-road.

Friday, October 12, 2007

Texture Layering Bug



When using multiple texture layers, like the example above which has a shadow in shader.textureList[2], modifications to the scene can cause the model to flash.

The fix, shown at right, is to avoid texture layer #1. For example, use layers 2 and 3 instead, by starting off by moving texture layer 1 to layer 2.

Don't know why this works, but it does.

Alpha Channel Addition


By adding additional chunks of white to an alpha channel, we can make an image increasingly transparent. This can be used to "wipe away" a decal layer such as dirt or grime which has an alpha layer and is sitting on top of a background image or, for 3d, a lower texture layer.

Wednesday, October 10, 2007

Decals



To get a non-repeating graphic (w/ alpha) on top of a tiled (repeating) graphic:
  1. Export model from 3dsmax that has the repeating texture (map) in a shader (material).
  2. Create a 32-bit alpha .png of the decal image.
  3. In Director, take the wall shader and add the decal texture as shader texture layer #2
  4. Set the decal shader layer to non-repeating
  5. Set the scale and position values for the decal layer until it's at the desired size and position.

tMbr3d = member( "DecalOnWall" )
tTexture = tMbr3d.newTexture( "hand", #fromCastMember, member( "hand_decal" ) )
tShader.textureList[2] = tTexture
tShader.blendFunctionList[2] = #blend
tShader.blendSourceList[2] = #alpha
tShader.textureTransformList[2].position = vector( 1.6, 0.3, 0.0 )
tShader.textureTransformList[2].scale = vector( 0.7, 0.5, 1.0 )
tShader.textureRepeatList[2] = false

Sunday, September 30, 2007

Particle Systems




References
Definition: Particle System - Wikipedia
Snow: Snowball Warfare , Newton's Snow, Javascript Snow, BBS Snow
Fire: Newton's Fire.

Thursday, September 27, 2007

Additive Blending

see:

http://www.noisecrime.com/develop/tutorials/additiveblend/index.html

IK Animation

"IK isn't supported. You need to limit bone sets to FK. Just
Use the biped in Max 3 and then attach it to the mesh with
The physique modifier - this should work without any problems." - ap

Light Map






The problem with director lighting is that it goes right through things. You can add a second texture layer that has bright and dark spots generated from a top-view render from 3dsmax. Usually we use this to add shadows so it's really more often a darkmap than a lightmap. (But everyone knows it as a "lightmap").

Note that the light/dark map image is grayscale (not black with alpha areas).

Hello World










This is the posting template for a Shockwave 3D testbed.