[ < ] | [ Up ] | [ > ] | [Top] | [Contents] | [Index] | [ ? ] |
abstract pass ParentPass { diffuse $diffuse_colour } material Test { technique { pass : ParentPass { set $diffuse_colour "1 0 0 1" } } } |
The ParentPass object declares a variable called "diffuse_colour" which is then overridden in the Test material's pass. The "set" keyword is used to set the value of that variable. The variable assignment follows lexical scoping rules, which means that the value of "1 0 0 1" is only valid inside that pass definition. Variable assignment in outer scopes carry over into inner scopes.
material Test { set $diffuse_colour "1 0 0 1" technique { pass : ParentPass { } } } |
The $diffuse_colour assignment carries down through the technique and into the pass.