Search code examples
flashnullconstantsvertex-shaderstage3d

Can constants (vertex or fragment) be reset / nullified in Context3D?


If I make multiple draw calls for various Program3D instances, is there a way that I can reset or nullify the constants if I'm no longer using them in the next following Program3D assignment?

Is it even necessary that I do something like this?

//Nullify 'vc0' in the vertex shader:
context3D.setProgramConstantsFromVector("vertex", 0, null);

Solution

  • No, constants are global state to the entire Context3D. Their content does not change if you change programs. The default value is (0,0,0,0), but if you do not use them in a program there is no reason to set them.