Global variable access in shading contexts
Houdini/SHOPs 2012. 11. 29. 15:25 |Global variable access in shading contexts
Each shading context is responsible for setting or modifying different variables. For example, the displacement context can modify the position of the surface being rendered, while the light context is responsible for setting the color of the light source. The Read/Write access of the global variables for each context is summarized in this table.
Variable | Type | Description | Displacement | Surface | Light | Shadow | Fog | |
---|---|---|---|---|---|---|---|---|
Cf | vector | The final color for the surface. The vector represents the RGB color for the surface. | - | W | - | - | R/W | |
Of | vector | The final opacity for the surface. A value of {1,1,0} will be opaque in red/green, but let through blue light from behind. See opacity vs. alpha. | - | W | - | - | R/W | |
Af | float | The final alpha for the surface. This is the value which is placed in the alpha channel of the output image. See opacity vs. alpha. | - | W | - | - | R/W | |
P | vector | The position of the point on the surface being shaded.
In light or shadow shaders, the Although | R/W | R/W* | R | R | R | |
Pz | float | The Z component of the point being shaded. | R | R | - | - | R | |
Ps | vector | In light & shadow shaders, this is the position of the point on the surface being illuminated. | - | - | R | R | - | |
I | vector | - | R | R | R | R | ||
Eye | vector | The position of the eye. | - | R | R | R | R | |
s , t | float | The parametric S and T (sometimes called U and V) coordinates on the surface being shaded. | R | R | R | R | R | |
dPds , dPdt | vector | The delta between the current position ( | R | R | R | R | R | |
N | vector | The shading normal for the surface. | vector | R/W | R/W | R | R | R |
Ng | vector | The geometric normal for the surface. This normal represents the “true” normal
of the surface being shaded. For example, with Phong shading, the | R | R | R | R | R | |
Cl | vector | Light color. | - | R/W | W | R/W | R/W | |
L | vector | The vector from the point on the surface to the light source. The length of this vector represents the distance to the light source. See how the L variable is initialized. | - | R | R/W | R | R | |
Lz | vector | The Z-axis in the space of the light. This is a unit vector. | - | - | R | R | - |
'Houdini > SHOPs' 카테고리의 다른 글
fog shader 2 (0) | 2013.01.17 |
---|---|
fog shader (0) | 2013.01.17 |
dPds, dPdt (0) | 2013.01.14 |
vex shading 참고 그림 (0) | 2013.01.11 |
Optional rendering parameters (0) | 2012.11.29 |