User Tools

Site Tools


This is an old revision of the document!


Variable [Root Context]

Brickyard : Functions > Utility

When plugged into a shader network, this brick iterates across the range of the variable, feeding all values, one after another, into the shader network during render (e.g. for each micropolygon in the case of I). The available options depend on what network the Variable brick is attached to. When not yet attached to a root, the only options available are “1”, “0”, PI, PI/2.

Snapshot

Parameters

Outputs

  • Variable Value : Variable - Description…

Settings

  • Variable :
    • 1
    • 0
    • PI
    • PI/2
    • BackgroundColor :
    • Cs : True surface color
    • E : Position of camera/Eye
    • FrameNumber :
    • I : Incident direction of a ray striking a surface point. I is the direction of the ray incident to the surface. The length of this vector is equal to the distance between the origin of the ray and the point on the surface. Thus the actual origin of the ray is available as P-I.
    • In : Normalized I (length=1)
    • Max : Maximum point of object world-space bounding box, point triplet
    • Min : Minimum point of object bounding box, point triplet
    • N : Surface shading normal
    • Nf : Normals Forward – geometry normal for forward-facing polygons, can plug alternative normals in, to control things like smoothing.
    • Ng : Surface geometric normal
    • Nn : Normalized N (unit length of 1)
    • Os : True surface opacity
    • P : Surface position, of type Point, or Light ray origin, or displaced surface position
    • SceneMax : Maximum point of scene bounding box, point triplet, used in altitude brick (not cameras, lights, have geometry, visible (not implemented), visible in render
    • SceneMin : Minimum point of scene bounding box, point triplet, used in altitude brick
    • V : Negative I
    • __noshadows : (DAZ Studio specific) Boolean, by object, use with if/else for example.
    • dPds : Derivative of surface texture along s
    • dPdsM : Sign (+/-) of dPds, used to calculate tangent space T and B for normal maps. Expensive to calculate, only available with normal maps. Similar to du and dv, but they are calculated from geometry, whereas this is calculated including smoothed normals.
    • dPdtime : Rate of change of time
    • dPdu : Derivative (rate of change) of surface position along u, change in u direction
    • dPdv : Derivative (rate of change) of surface position along v
    • dtime : The amount of time covered by this shading sample - use FrameNumber instead, e.g. for cycling textures during animation.
    • du : Change in surface parameter in the u direction
    • dv : Change in surface parameter in the v direction
    • ncomps : Number of color components
    • s : Surface texture coordinate equivalent to x
    • t : Surface texture coordinate equivalent to y
    • time : Current shutter time
    • u : Surface parameter x
    • v : Surface parameter y

Examples

  • In this example, …
    Example 1