Phong MAT
Summary
The Phong MAT creates a material using the Phong Shading model. It has support for textures, reflections, bumps, cone lights, rim lights, alpha maps and more. You can output its GLSL shader into two DATs for further adaptation in a GLSL MAT by using the Output Shader parameter.
Phong Shading models three types of reflected light:
- Ambient - Ambient is considered light that does not come from any particular direction and is therefore constant across the surface. In the physical world, ambient light is created from the reflection of light off surfaces in the environment.
- Diffuse - Diffuse models the light reflected by matte surfaces. This light is reflected equally in all directions, therefore the position of the observer does not effect the percieved illumination.
- Specular - Specular models the light reflected by glossy surfaces. This light is reflected mainly in the direction of the reflected ray and is attenuated by the 'shiny-ness' of an object. Since the light reflected from the surface is mainly in the direction of the reflected ray, the position of the observer determines the specular highlight on the surface.
NOTE: We see the color of an object because of the color of light that the material reflects.
Phong Shading produces very nice specular highlights, although it is still an approximation and not physically accurate. Contrasting with the Gouraud shading model that calculates the lighting at each vertex and interpolates the value across the polygon, Phong calculates the lighting at each pixel.
To see how all of the different parts are summed together by looking at the Phong Lighting Equation article.
Parameters - RGB Page
ambdiff
- Uses the Diffuse parameter for Ambient when checked.
diff
- ⊞ - The color of the diffuse light reflected from the material.
- Red
diffr
-
- Green
diffg
-
- Blue
diffb
-
amb
- ⊞ - The color of the ambient light reflected from the material.
- Red
ambr
-
- Green
ambg
-
- Blue
ambb
-
spec
- ⊞ - The color of the specular light reflected from the material. This changes the color of the highlights on shiney objects.
- Red
specr
-
- Green
specg
-
- Blue
specb
-
emit
- ⊞ - This is the color that the material will emit even if there is no light.
- Red
emitr
-
- Green
emitg
-
- Blue
emitb
-
constant
- ⊞ - Adds to the final color. Where there are point colors, finalcolor += Point Color * Constant Color. This behaves like there is ambient illumination of 1 1 1. It is not affected by textures or transparency.
- Red
constantr
-
- Green
constantg
-
- Blue
constantb
-
shininess
- Controls the specular highlights (glossyness) of an object. Higher settings are more glossy, like plastic or shiny metal. Lower settings give more of a matte finish.
colormap
- ⊞ - Specifies a TOP texture that is multiplied by the results of all of the lighting calculations. The alpha of this map is used as a part of calculating the objects alpha. Clicking on the arrows to the right of the map field will open the Texture Sampling Parameters for Color Map. The other Map parameters below will have their own Texture Sampling Parameters as well.
colormapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
colormapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
colormapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
colormapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
colormapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
colormapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
colormapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
normalmap
- ⊞ - Uses a Normal Map from TOPs to create a 'bump map' effect. Bump-mapping simulates bumps or wrinkles in a surface to give it a 3D depth effect. Your geometry must have tangent attributes created for this feature to work (T[4]). Create these using the Attribute Create SOP.
normalmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
normalmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
normalmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
normalmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
normalmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
normalmapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
normalmapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
bumpscale
- A multiplier for the 'bump effect' created by the Normal Map parameter.
heightmapenable
- Enables height mapping.
heightmap
- ⊞ - Specifies a height texture map. The height map is used in conjunction with the normal map to perform parallax mapping.
heightmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
heightmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
heightmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
heightmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
heightmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
heightmapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
heightmapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
heightmapchannelsource
- ⊞ -
- Luminance
luminance
-
- Red
red
-
- Green
green
-
- Blue
blue
-
- Alpha
alpha
-
- RGB Average
rgbaverage
-
- RGBA Average
average
-
parallaxscale
- Scale value applied to the height map. Can be used to increase or exaggerate the effect.
parallaxocclusion
- Enables parallax occlusion, an enhancement of the parallax mapping technique used with the height map. Parallax occlusion improves the quality of the texture offsetting in parallax mapping so that the higher parts of the height map appear to occlude the lower parts, giving a better illusion of height.
displaceverts
- When Enable Height Map above is On, setting Displace Vertices to On will enable true displacement mapping where the vertices of the geometry are displaced based on the Height Map texture and the parameters below.
displacescale
- A multiplier for the displacement amount.
displacemid
- Sets the middle point of displacement map as the start position for the displacement effect.
diffusemap
- ⊞ - Specifies a TOP that multiples the Diffuse Color. The object must have texture coordinates. The alpha of this map is ignored.
diffusemapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
diffusemapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
diffusemapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
diffusemapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
diffusemapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
diffusemapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
diffusemapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
specmap
- ⊞ - Specifies a TOP texture that is multiplied with the Specular color parameter of the material. The object must have texture coordinates. The alpha of this map is ignored.
specmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
specmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
specmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
specmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
specmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
specmapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
specmapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
emitmap
- ⊞ - Specifies a TOP texture that is multiplied with the Emit color parameter of the material. The object must have texture coordinates. The alpha of this map is ignored.
emitmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
emitmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
emitmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
emitmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
emitmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
emitmapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
emitmapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
envmap
- ⊞ - Uses a TOP texture to define an environment map for the material. Environment mapping simulates an object reflecting its surroundings. The TOP defined in this parameter is the texture that will be reflected. The Env Map is added to whatever the normal lighting will be, so to make an object purely reflective turn the Diffuse and Specular parameters to 0. This input expects a sphere map. An example of a sphere map can be found here. This input will also accept a cube map, created with the Cube Map TOP or the Render TOP's Render Cube Map parameter.
envmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
envmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
envmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
envmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
envmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
envmapcolor
- ⊞ - This color is multiplied with the texture specified by the Environment Map parameter above.
- Red
envmapcolorr
-
- Green
envmapcolorg
-
- Blue
envmapcolorb
-
envmaprotate
- ⊞ - Rotate the texture specified by the Environment Map parameter above.
- X
envmaprotatex
-
- Y
envmaprotatey
-
- Z
envmaprotatez
-
envmaptype2d
- ⊞ - Select between using a sphere map or an equirectangular map as the Environment Map type.
- Sphere Map
spheremap
-
- Equirectangular
equirect
-
frontfacelit
- ⊞ - Controls how the polygon's normal is used to light the front face of the polygon. For more information refer to the Two-Sided Lighting article.
- Use Per-Light(s) Parameter
uselight
-
- Front Lit
frontlit
-
- Back Lit
backlit
-
backfacelit
- ⊞ - Controls how the polygon's normal is used to light the back face of the polygon. For more information refer to the Two-Sided Lighting article.
- Use Per-Light(s) Parameter
uselight
-
- Front Lit
frontlit
-
- Back Lit
backlit
-
outputshader
- This button will bring up a dialog that will create a GLSL MAT and Text DATs with shader code that matches whatever effect this Phong MAT is currently creating. Since shaders are dependent on the number and type of lights, it will list some possible different shader choices, based on what lighting configurations have been used in the current system. If no shaders are listed in the dialog, it means no shader has been rendered in the current session of TouchDesigner. Turn on the viewer for the Phong MAT, or setup a render in a Render TOP. That will create/compile some shaders and will cause the list to be populated. For example if you want to see a shader that does shadow mapping, setup a render that does shadow mapping and you will see that come up in the list.
Parameters - Alpha Page
Note: Simply applying alpha to an object does not make it transparent. For more information refer to the Transparency article.
alphamap
- ⊞ - This map multiplies the alpha of the object. It uses the red channel of the map, other channels are ignored.
alphamapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
alphamapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
alphamapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
alphamapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
alphamapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
alphamapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
alphamapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
alphamode
- Turning this off will make the alpha change depending on orientation of each polygon's normal compared to the camera. Normals that are pointing at the camera will results in the polygon having an alpha of Alpha Front. Normals that are perpendicular to the camera (facing sideways/up/down) will have Alpha Side for their alpha.
alphafront
- The opacity of the material. This parameter is multiplied by point alpha of the object (as will as any other alpha source).
alphaside
- This is used for non-uniform alpha. It is the alpha value polygons that are facing away from the camera will get.
rolloff
- Controls how the alpha changes from Alpha Front to Alpha Side.
postmultalpha
- At the end of all of the calculations, the color (RGB) is multiplied by the calculated alpha. You can stop this from happening by turning off this toggle.
alphamultlight
- When this is enabled, the luminance of the lighting will be multiplied by the alpha, to decrease/increase it.
Parameters - Multi-Texturing Page
On the Multi-texturing page of the Phong material, you can have up to 4 texture maps and choose any of the 8 possible texture coordinates for each map. By default the texture maps are multiplied together, but there is a field for a custom GLSL code that can be used. Here's how that works:
The 4 texture maps are referred to in the parameter by t0, t1, t2 and t3 respectively. So the default equation if all 4 texture maps are used is: t0 * t1 * t2 * t3. You can use and constants and other math operators, so for example t0 + (t1 * 0.5) is valid. If they refer to a map that doesn't exist, the shader won't compile correctly (e.g. using t3 when it isn't set or the TOP doesn't exist).
They can also refer to specific components of the texture using .r .g .b and .a. So for example if you want to do t0 over t1, the expression would be:
t0 + (t1 * (1.0 - t0.a))
The output from your expression must be a vec4, so for example:
t0.rgb + t1.rgb // Error vec4(t0.rgb + t1.rgb, 1.0) // Works
The alpha from the result of these maps is used.
multitexturing
- Enables multi-texturing. This disables the Color Map parameter.
texture1
- ⊞ - You can specify up to 4 textures for multi-texturing.
texture1mapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture1mapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture1mapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture1mapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
texture1mapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
texture1coord
- ⊞ - Specifies which texture coordinate to use for the map.
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
texture1coordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
texture2
- ⊞ - You can specify up to 4 textures for multi-texturing.
texture2mapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture2mapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture2mapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture2mapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
texture2mapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
texture2coord
- ⊞ - Specifies which texture coordinate to use for the map.
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
texture2coordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
texture3
- ⊞ - You can specify up to 4 textures for multi-texturing.
texture3mapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture3mapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture3mapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture3mapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
texture3mapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
texture3coord
- ⊞ - Specifies which texture coordinate to use for the map.
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
texture3coordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
texture4
- ⊞ - You can specify up to 4 textures for multi-texturing.
texture4mapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture4mapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture4mapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
texture4mapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
texture4mapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
texture4coord
- ⊞ - Specifies which texture coordinate to use for the map.
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
texture4coordnterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
multitexexpr
- GLSL code that combines the texture images (look to the start of this section for more details). This parameter can be left blank (which means the maps will just be multiplied together).
Parameters - Rim Page
Other rim lights have the same parameters, internal parameter names just have a different number instead of 1.
rimlight
- Sequence of rim light info
rimlight0enable
- Enables this rim light.
rimlight0map
- ⊞ - This map will multiple the calculated rim light color.
rimlight0mapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
rimlight0mapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
rimlight0mapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
rimlight0mapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
rimlight0mapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
rimlight0mapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
rimlight0mapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
rimlight0color
- ⊞ - The color of the rim light.
- Red
rimlight0colorr
-
- Green
rimlight0colorg
-
- Blue
rimlight0colorb
-
rimlight0center
- The center of the rim lights location, situated somewhere on a 360 degree circle.
rimlight0width
- How far from the center the rim light extends.
rimlight0strength
- Controls the brightness of the rim light.
rimlight0strengthramp
- You can specify a horizontal ramp (it will sample the texture at v = 0.5), which controls the the rim lights strength.
Parameters - Advanced Page
shadowstrength
- This parameter will control how much being in a shadow will change the color of the lighting. At 1 the object will take on the Shadow Color parameter, at 0 it will behave as if it's not in a shadow, even if it is.
shadowcolor
- ⊞ - The color that will be used in shadowed areas.
- Red
shadowcolorr
-
- Green
shadowcolorg
-
- Blue
shadowcolorb
-
darknessemit
- The Phong MAT calculates the current brightness of color of the objects, after taking into account lights, rim lights, emission etc. It then uses this brightness (between 0-1) and fades in the Darkness Emit Color. The darker the area, the more of the darkness emit color that will be applied.
darknessemitcolor
- ⊞ - The color that is used for areas that are in darkness.
- Red
darknessemitcolorr
-
- Green
darknessemitcolorg
-
- Blue
darknessemitcolorb
-
darknessemitmap
- ⊞ - This map multiplies the Darkness Emit Color. This maps alpha is not used.
darknessemitmapextendu
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
darknessemitmapextendv
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
darknessemitmapextendw
- ⊞ -
- Hold
hold
-
- Zero
zero
-
- Repeat
repeat
-
- Mirror
mirror
-
darknessemitmapfilter
- ⊞ -
- Nearest
nearest
-
- Linear
linear
-
- Mipmap Linear
mipmaplinear
-
darknessemitmapanisotropy
- ⊞ -
- Off
off
-
- 2x
2x
-
- 4x
4x
-
- 8x
8x
-
- 16x
16x
-
darknessemitmapcoord
- ⊞ -
- Texture Layer 0 (uv[0-2])
uv0
-
- Texture Layer 1 (uv[3-5])
uv1
-
- Texture Layer 2 (uv[6-8])
uv2
-
- Texture Layer 3 (uv[9-11])
uv3
-
- Texture Layer 4 (uv[12-14])
uv4
-
- Texture Layer 5 (uv[15-17])
uv5
-
- Texture Layer 6 (uv[18-20])
uv6
-
- Texture Layer 7 (uv[21-23])
uv7
-
- Screen Space Coordinates
screenspace
-
darknessemitmapcoordinterp
- ⊞ -
- Perspective Correct
perspectivecorrect
-
- Linear (noperspective)
linear
-
spec2
- ⊞ - Adds a secondary specular highlight color.
- Red
spec2r
-
- Green
spec2g
-
- Blue
spec2b
-
shininess2
- Controls the secondary specular highlights (glossyness) of an object. Higher settings are more glossy, like plastic or shiny metal. Lower settings give more of a matte finish.
writecameradepthtoalpha
- This causes the camera space depth of the pixel to be written to the alpha channel of the output TOP. This value can be useful for post-processing effects, but ofcourse you will not have the result of all the alpha calculations if you turn this on (although they'll get used to multiply the output color, assuming Post-Mult Color by Alpha is enabled.
applypointcolor
- Normally the color attribute (Cd[4]) coming from the SOP is used in the lighting calculation, you can turn off using the color attribute by un-checking this parameter.
instancetexture
- ⊞ - When provider per-instance textures in the Geometry COMP, this parameter selects which map the instance texture will be applied as.
- Color Map
colormap
-
- Normal Map
normalmap
-
- Diffuse Map
diffusemap
-
- Specular Map
specmap
-
- Emit Map
emitmap
-
- Alpha Map
alphamap
-
- Darkness Emit Map
darknessemitmap
-
- Color Map
rimlight0map
-
color
- Sequence of color buffers
color0output
- ⊞ - Allows sending things like normals or diffuse color to different Render TOP color buffers in a single pass.
- Zero
zero
-
- One
one
-
- World Space Position
worldspaceposition
-
- World Space Normal
worldspacenormal
-
- Camera Space Position
cameraspaceposition
-
- Camera Space Normal
cameraspacenormal
-
- Point Color
pointcolor
-
- Texture Coord 0
texturecoord0
-
- Diffuse Map
diffusemap
-
- Normal Map
normalmap
-
- Spec Map
specmap
-
- Emit Map
emitmap
-
- Emit Color
emitcolor
-
- Diffuse Color
diffcolor
-
- Diffuse Lighting
difflighting
-
- Final Diffuse Color
finaldiffcolor
-
- Specular Color
speccolor
-
- Specular 2 Color
spec2color
-
- Specular Lighting
speclighting
-
- Specular 2 Lighting
spec2lighting
-
- Final Specular Color
finalspeccolor
-
- Shadow Strength
shadowstrength
-
- Normalized Shadow Strength
normalizedshadowstrength
-
Parameters - Deform Page
Refer to the Deform Article for more information on doing deforms in TouchDesigner.
dodeform
- Enables deforms on this material.
deformdata
- ⊞ - Specifies where the deform bone data will be obtained.
- From a SOP
sop
-
- From another MAT
mat
-
- From a DeformIn MAT
deformin
-
targetsop
- Specifies the SOP that contains the deform capture attributes.
pcaptpath
- Specifies the name of the pCaptPath attribute to use. When your geometry has been put through a Bone Group SOP, the attributes will be split into names like pCaptPath0, pCaptPath1. You can only render 1 bone group at a time, so this should match the group you are rendering with this material.
pcaptdata
- Much like pCaptPath Attrib.
skelrootpath
- Specifies the path to the COMP where the root of the skeleton is located.
mat
- When obtaining deform data from a MAT or a Deform In MAT, this is where that MAT is specified.
Parameters - Common Page
Blending
Blending is summing the color value of the pixel being drawn and the pixel currently present in the Color-Buffer. Blending is typically used to simulate Transparency.
The blending equation is:
Final Pixel Value = (Source Blend * Source Color) + (Dest Blend * Destination Color)
blending
- This toggle enables and disables blending. However see the wiki article Transparency.
blendop
- ⊞ -
- Add
add
-
- Subtract
subtract
-
- Reverse Subtract
revsubtract
-
- Minimum
minimum
-
- Maximum
maximum
-
srcblend
- ⊞ - This value is multiplied by the color value of the pixel that is being written to the Color-Buffer (also know as the Source Color).
- Zero
zero
-
- Dest Color
dcol
-
- One Minus Dest Color
omdcol
-
- Source Alpha
sa
-
- One Minus Source Alpha
omsa
-
- Dest Alpha
da
-
- One Minus Dest Alpha
omda
-
- Source Alpha Saturate
sas
-
- One
one
-
- Constant Color
constantcol
-
- One Minus Constant Color
omconstantcol
-
- Constant Alpha
constanta
-
- One Minus Constant Alpha
omconstanta
-
destblend
- ⊞ - This value is multiplied by the color value of the pixel currently in the Color-Buffer (also known as the Destination Color).
- One
one
-
- Src Color
scol
-
- One Minus Src Color
omscol
-
- Source Alpha
sa
-
- One Minus Source Alpha
omsa
-
- Dest Alpha
da
-
- One Minus Dest Alpha
omda
-
- Zero
zero
-
- Dest Color
dcol
-
- One Minus Dest Color
omdcol
-
- Source Alpha Saturate
sas
-
- Constant Color
constantcol
-
- One Minus Constant Color
omconstantcol
-
- Constant Alpha
constanta
-
- One Minus Constant Alpha
omconstanta
-
separatealphafunc
- This toggle enables and disables separate blending options for the alpha values.
blendopa
- ⊞ -
- Add
add
-
- Subtract
subtract
-
- Reverse Subtract
revsubtract
-
- Minimum
minimum
-
- Maximum
maximum
-
srcblenda
- ⊞ - This value is multiplied by the alpha value of the pixel that is being written to the Color-Buffer (also know as the Source Alpha).
- Zero
zero
-
- Dest Color
dcol
-
- One Minus Dest Color
omdcol
-
- Source Alpha
sa
-
- One Minus Source Alpha
omsa
-
- Dest Alpha
da
-
- One Minus Dest Alpha
omda
-
- Source Alpha Saturate
sas
-
- One
one
-
- Constant Color
constantcol
-
- One Minus Constant Color
omconstantcol
-
- Constant Alpha
constanta
-
- One Minus Constant Alpha
omconstanta
-
destblenda
- ⊞ - This value is multiplied by the alpha value of the pixel currently in the Color-Buffer (also known as the Destination Alpha).
- One
one
-
- Src Color
scol
-
- One Minus Src Color
omscol
-
- Source Alpha
sa
-
- One Minus Source Alpha
omsa
-
- Dest Alpha
da
-
- One Minus Dest Alpha
omda
-
- Zero
zero
-
- Dest Color
dcol
-
- One Minus Dest Color
omdcol
-
- Source Alpha Saturate
sas
-
- Constant Color
constantcol
-
- One Minus Constant Color
omconstantcol
-
- Constant Alpha
constanta
-
- One Minus Constant Alpha
omconstanta
-
blendconstant
- ⊞ -
- Blend Constant Color
blendconstantr
-
- Blend Constant Color
blendconstantg
-
- Blend Constant Color
blendconstantb
-
blendconstanta
-
legacyalphabehavior
-
postmultalpha
- Multiplies the color by alpha after all other operations have taken place.
pointcolorpremult
- ⊞ -
- Already Pre-Multiplied By Alpha
alreadypremult
-
- Pre-Multiply By Alpha in Shader
premultinshader
-
depthtest
- Enables and disables the Depth-Test. If the depth-test is disabled, depths values aren't written to the Depth-Buffer.
depthfunc
- ⊞ - The depth value of the pixel being drawn is compared to the depth value currently in the depth-buffer using this function. If the test passes then the pixel is drawn to the Frame-Buffer. If the test fails the pixel is discarded and no changes are made to the Frame-Buffer.
- Less Than
less
-
- Less Than or Equal
lessorequal
-
- Equal
equal
-
- Greater Than
greater
-
- Greater Than or Equal
greaterorequal
-
- Not Equal
notequal
-
- Always
always
-
Depth Test
Depth-Testing is comparing the depth value of the pixel being drawn with the pixel currently in the Frame-Buffer. A pixel that is determined to be in-front of the pixel currently in the Frame-Buffer will be drawn over it. Pixels that are determined to be behind the pixel currently in the Frame-Buffer will not be drawn. Depth-Testing allows geometry in a 3D scene to occlude geometry behind it, and be occluded by geometry in-front of it regardless of the order the geometry was drawn.
For a more detailed description of Depth-Testing, refer to the Depth-Test article.
depthwriting
- If Write Depth Values is on, pixels that pass the depth-test will write their depth value to the Depth-Buffer. If this isn't on then no changes will be made to the Depth-Buffer, regardless of if the pixels drawn pass or fail the depth-test.
alphatest
- This enables or disables the pixel alpha test.
alphafunc
- ⊞ - This menu works in conjunction with the Alpha Threshold parameter below in determining which pixels to keep based on their alpha value.
- Less Than
less
-
- Less Than or Equal
lessorequal
-
- Greater Than
greater
-
- Greater Than or Equal
greaterorequal
-
alphathreshold
- This value is what the pixel's alpha is compared to to determine if the pixel should be drawn. Pixels with alpha greater than the Alpha Threshold will be drawn. Pixels with alpha less than or equal to the Alpha Threshold will not be drawn.
wireframe
- ⊞ - Enables and disables wire-frame rendering with the option of OpenGL Tesselated or Topology based wireframes.
- Off
off
-
- OpenGL Tesselated Wire Frame
tesselated
-
- Topology Wire Frame
topology
-
Alpha Test
Alpha-testing allows you to choose to draw or not draw a pixel based on its alpha value.
wirewidth
- This value is the width that the wires will be. This value is in pixels.
cullface
- ⊞ - Selects which faces to render.
- Use Render Setting
userender
- Use the render settings found in the Render or Render Pass TOP.
- Neither
neither
- Do not cull any faces, render everything.
- Back Faces
backfaces
- Cull back faces, render front faces.
- Front Faces
frontfaces
- Cull front faces, render back faces.
- Both Faces
bothfaces
- Cull both faces, render nothing.
polygonoffset
- Turns on the polygon offset feature.
polygonoffsetfactor
-
polygonoffsetunits
-
Wire Frame
The wire-frame feature will render the geometry as wire-frame, using the actual primitive type used in the render. What this means is surfaces like Metaballs, NURBs and Beziers will become a wire-frame of the triangles/triangle-strips used to render them (since these types of primitives can't be natively rendered in OpenGL).
Cull Face
The cull face parameter will cull faces from the render output. This can be used as an optimization or sometimes to remove artifacts. See Back-Face Culling for more infomation.
Polygon Depth Offset
This feature pushes the polygons back into space a tiny fraction. This is useful when you are rendering two polygons directly on-top of each other and are experiencing Z-Fighting. Refer to Polygon Depth Offset for more information. This is also an important feature when doing shadows.
Info CHOP Channels
Extra Information for the Phong MAT can be accessed via an Info CHOP.
Common MAT Info Channels
Common Operator Info Channels
- total_cooks - Number of times the operator has cooked since the process started.
- cook_time - Duration of the last cook in milliseconds.
- cook_frame - Frame number when this operator was last cooked relative to the component timeline.
- cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
- cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
- cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
- cooked_this_frame - 1 if operator was cooked this frame.
- warnings - Number of warnings in this operator if any.
- errors - Number of errors in this operator if any.
TouchDesigner Build: