User Guide
659
Example
In this example, a shader is set up to simulate a reflective garden ball. The shader’s first
textureLayer is set to a spherical mapping and the third textureLayer is set to use a #refection style
mapping. The shader’s textureList[3] entry will appear to reflected from the environment onto all
models which use this shader.
member("scene").shader("GardenBall).textureList[1] = \
member("scene").texture("FlatShinyBall")
member("scene").shader("GardenBall").textureModeList[1] = \
#wrapSpherical
member("scene").shader("GardenBall").textureList[3] = \
member("scene").texture("GardenEnvironment")
member("scene").shader("GardenBall").textureModeList[3] = \
#reflection
See also
textureTransformList, wrapTransform
textureRenderFormat
Syntax
getRenderServices().textureRenderFormat
Description
3D rendererServices property; allows you to get or set the default bit format used by all textures
in all 3d cast members. Use a texture's texture.RenderFormat property to override this setting for
specific textures only. Smaller sized bit formats (i.e 16 bit variants such as #rgba5551) use less
hardware accelerator video ram, allowing you to make use of more textures before being forced to
switch to software rendering. Larger sized bit formats (i.e. 32 bit variants such as #rgba8888)
generally look better. In order to use alpha transparency in a texture, the last bit must be nonzero.
In order to get smooth transparency gradations the alpha channel must have more than 1 bit of
precision.
Each pixel formats has four digits, with each digit indicating the degree of precision for red, green,
blue, and alpha. The value you choose determines the accuracy of the color fidelity (precision of
the alpha channel) and the amount of memory used by the hardware texture buffer. You can
choose a value that improves color fidelity or a value that allows you to fit more textures on the
card. You can fit twice as many 16-bit textures as 32-bit textures in the same space. If a movie uses
more textures than fit on a card at a the same time, Director switches to
#software rendering.
You can specify any of the following values for
textureRenderFormat:
• #rgba8888: 32 bit color mode with 8 bits each for red, green, blue, and alpha
• #rgba8880: same as above, with no alpha value
• #rgba5650: 16-bit color mode with no alpha; 5 bits for red, 6 for green, 5 for blue
• #rgba5550: 16-bit color mode with no alpha; 5 bits each for red, green, and blue, with no alpha
measure
• #rgba5551: 16-bit color mode with 5 bits each for red, green, and blue; 1 bit for alpha
• #rgba4444: 16-bit color mode with 4 bits each for red, green, blue, and alpha
The default value is
#rgba5551.