[Bf-committers] Proposal for unifying nodes
roblovski at gmail.com
Mon Jun 15 18:44:56 CEST 2009
2009/6/15 Keir Mierle <mierle at gmail.com>:
> If I recall correctly, the reason for the separation of node tree
> types was that material nodes need to be high performance. Making nodes general
> would impose high performance penalties on shader nodes, which
> evaluate their trees millions of times.
Under the new system, shader nodes would not evaluate their trees
millions of times. The tree would be evaluated once and return a
Shader object, which itself would be evaluated millions of times. The
shader object is not general in the sense that the node system is, it
is optimized for being evaluated millions of times. So no performance
> (... LLVM stuff ...)
The good thing about the unified node system is that you can layer
whatever you like on top of it, including, if necessary, some form of
JIT compiler. If this would benefit the shader system, simply evaluate
the nodetree as normal to return a Shader (once!) then define a
CompiledShader* compile(Shader*) function to be called on that shader.
At this point the node system no longer has anything to do with it --
it can't restrict you in any way.
More information about the Bf-committers