07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

Layer property lists: blendFunctionList, blendSourceList, blendConstantList, textureList, textureModeList,<br />

textureRepeatList, textureTransformList, and wrapTransformList<br />

Color properties<br />

A #standard shader has four color properties. These properties determine how the shader as a whole reacts to light<br />

sources.<br />

<strong>Director</strong> uses three different kinds of light sources:<br />

“Ambient light” on page 123<br />

Diffuse light: “Directional lights” on page 124, “Point lights” on page 125, and “Spot lights” on page 126<br />

“Specular Light” on page 130<br />

See “Interactions with shaders” on page 123 for a comparison table. The ambient, diffuse, and specular properties of a<br />

shader determine how the shader reacts to each of these different types of lighting. For example, imagine a shader with<br />

the following properties:<br />

vShader = member("3D").newShader("Example")<br />

vShade.ambient = rgb("#0000FF")<br />

vShade.diffuse = rgb("#FFFFFF")<br />

vShade.specular = rgb("#808080")<br />

This shader only reflects the blue channel of the ambient light. It reflects all of the light from diffuse sources<br />

(directional, point, and spot lights). It reflects 50% of all specular light from diffuse sources whose specular property<br />

is set to TRUE. In other words, it appears blue on faces that are pointing away from any diffuse light source, and it<br />

shows dim specular highlights where a light bounces off its surface directly towards the camera.<br />

Note: If there are one or more textures attached to the shader, and the shader's useDiffuseWithTexture property is set to<br />

FALSE, then the shader does not react to diffuse light. The useDiffuseWithTexture property is FALSE by default on all<br />

new shaders.<br />

Emissive<br />

The emissive property allows you to make a shader glow with its own light. If you want to use a baked texture on a<br />

model, then you must set the emissive property of all its shaders to rgb(“#FFFFFF”).<br />

You can see a demo where the emissive property of a shader is changed to highlight the model under the mouse at<br />

“Pick Action behavior” on page 244.<br />

Surface properties<br />

Surface properties are applied to the whole shader.<br />

shininess changes how shiny the surface of the model appears to be. A value of 0 creates a matte surface. Values<br />

from 1.0 and 100.0 make the surface shiny to varying degrees, with 1.0 being the most shiny and 100.0 being the<br />

least. A value greater than 0.0, but less than 1.0 is treated is if it were 1.0. The default value for new shaders is 30.0.<br />

The effect of shininess will only be apparent if the specular color of the shader is not black. See also the note below<br />

concerning the flat property.<br />

transparent and blend determine whether you can see through the surface of the model. The transparent property<br />

can be set to TRUE or FALSE; the blend property can have any value between 0.0 and 100.0. If transparent is FALSE,<br />

then the model will appear opaque, regardless of the value of blend. If transparent is TRUE, then the lower the value<br />

of blend, the more transparent the model will appear. If blend is set to 100.0 then the model will appear fully opaque,<br />

even if transparent is set to TRUE. See the note below about issues with more than one semi-transparent models in<br />

a scene.<br />

Last updated 8/26/2011<br />

132

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!