[Bf-committers] OSL Composite Node

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Jan 12 16:30:37 CET 2013


On Sat, Jan 12, 2013 at 9:19 AM, Dan Eicher <dan at trollwerks.org> wrote:
> >From reading the code it looks like in order to set the individual
> ShadingSystem::Parameters() one needs to clear/redo the shader for every
> pixel shading operation. Seems like it's setup to shade a whole lot of
> points using the same parameters and not really made to update them in the
> middle of a shading pass.

The Parameter method is intended to be called before the shader is
compiled, I think generally the ShadingSystem should not get called
from worker threads, all the stuff there needs to be done before you
actually run the shaders.

> What I'd like to do is load the shader and then update the parameter input
> values on-the-fly, is this even possible?

There's a way to set these parameters but it's not efficient, so you
can probably get it working but it could be quite slow. What you have
to do is set the "lockgeom" attribute for the shading system to 0.
Then for each input parameter, it will call the
RenderServices::get_userdata callback to retrieve the value.

This is normally intended for looking up attributes on the geometry
(texture coordinates, ..), but it should work here as well.

Brecht.


More information about the Bf-committers mailing list