3D Lingo Dictionary > L-N > newShader

 

newShader

Syntax

member(whichCastmember).newShader(newShaderName, #shaderType)

Description

3D command; creates a new shader of the specified #shaderType within the referenced cast member's shader list and returns a reference to the new shader. All shaders in the shader list must have a unique name. The #shaderType argument determines the style in which the shader is applied and the has the following possible values:

#standard shaders are photorealistic, and have the following properties: ambient, blend, blendConstant, blendConstantList, blendFunction, blendFunctionList, blendSource, blendSourceList, diffuse, diffuseLightMap, emissive, flat, glossMap, ilk, name, reflectionMap, renderStyle, shininess, specular (shader), specularLightMap, texture, textureMode, textureModeList, textureRepeat, textureRepeatList, textureTransform, textureTransformList, transparent, useDiffuseWithTexture, wrapTransform, and wrapTransformList.

#painter shaders are smoothed out, and have the appearance of a painting, and have the following properties in addition to all of the #standard properties: colorSteps, highlightPercentage, highlightStrength, name, shadowPercentage, shadowStrength, and style.

#engraver shaders are lined, and have the appearance of an engraving, and have the following properties in addition to all of the #standard properties: brightness, density, name, and rotation (engraver shader).

#newsprint shaders are in a simulated dot style, have the appearance of a newspaper reproduction, and have the following properties in addition to all of the #standard properties: brightness, density, name.

Each type of shader has a specific group of properties that can be used with that type of shader, in addition all shader types have access to the #standard shader properties. However, although you can assign any #standard shader property to a shader of another type, the property may not have a visual effect. This happens in cases where the #standard property, if applied, would override the nature of the shader type. An example of this is the diffuseLightMap standard shader property which is ignored by #engraver, #newsprint, and #painter type shaders.

Example

This statement creates a #painter shader called newPainter.

newPainter = member("3D World").newShader("newPainter",#painter)

See also

shader