...
Because retrieving the UV coordinates is a costly process, it is best to centralize this operation in a single shader and share the results with all shaders. For a shader to benefit of this, it may declare a parameter similar to this:
Code Block | ||||
---|---|---|---|---|
| ||||
float uvCoord[2] = { 0, 0 } [[ string default_connection = "uvCoord", int skip_init = 1, string label = "UV Coordinates", string widget = "null" ]], |
...