Showing posts with label texture. Show all posts
Showing posts with label texture. Show all posts

Wednesday, August 27, 2008

Bitmap Filters

See Jorge's: http://www.lab.embrion2.com/director/bitmap_filters/fx_03_d11.htm

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.

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

Thursday, September 27, 2007

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).