Date
1 - 1 of 1
Lazy evaluation
Jono Gibbs <jono...@...>
Hello OSL-folk!
toggle quoted message
Show quoted text
I've been thinking about our shading system and how it maps to OSL, and am curious what y'all think. First, our shaders inputs are evaluated in a very lazy fashion. For instance, if a shader had input colors A and B, both bound to the output of other shaders, then code like this: if (something) { return A; } else { return B; } Would cause only one of the two input shaders to be evaluated and not evaluated until "A" or "B" was first needed. Then on top of the we allow shaders to modify the global shading state, so I can do: uv *= 4; result = A; uv *= 12; result += B; And the result is the shader attached to "A" sees different uvs than "B" does. The benefit is we can write some powerful shaders which are very useful in a dag/graph authoring environment which otherwise would need more nodes and more user-visible complexity. So, is this just totally an abomination? --jono --mobile-- On Mar 16, 2010, at 8:41 PM, Larry Gritz <l...@...> wrote:
Minor oversight on my part: Cliff, please don't commit the change until we get a signed CLA from Chris. I've sent it to him as well as posted it in the "downloads" section of the google code web site. |
|