Hi Terry,

On Fri, 2005-06-17 at 10:40 -0500, Terry Welsh wrote:
> Thanks for adding that.  It looks like the & is not available in GLSL,
> which is why your driver doesn't implement it.  Operators are listed
> on page 83 of the orange book.  However, the & is reserved in the GLSL
> spec, so they might use it in the future.  Currently, this data would
> probably have to be passed as an array of bools or individual bools
> with unique names.

That would be a workaround, yes.

> I have given this problem some more thought in the last couple days,
> and I still cannot come up with the best all-around solution.  For
> example, I can implement one lighting function that handles all types
> of lights, or I can implement specialty lighting functions that are
> more efficient.  But for specialty lighting functions, I also need to
> tell my program what type of light to use with each light index. 
> Asking OpenSG for that much information is probably overkill.

Yup.

> As long as conditionals executed fast enough in GLSL, using one big
> lighting function with something like OSGActiveLightsMask is probably
> the most flexible solution.  

A real solution for this problem would entail solving the general
orthogonality problem for shaders. I'm thinking about adding a shader
snippet to each light source that is assembled and compiled (and cached)
before geometry is rendered. Dynamic branching sounds like overkill for
something like this, which is rather static in nature (usually the types
of light sources doesn't change very often). An alternative would be
compile-time constant handling in the shader compiler, which you can't
really do in GLSL. Chad Austin is working on a functional shading
language that is more suited to these kinds of conditional compilations
(ans has some other advantages), but it's not clear yet how far we can
push it towards becoming a generally usable and available system (it's
primarily his master's research, so there are limits to how much
polishing is possible).

In general this whole topic is something Gerrit is working on for his
PhD, but he doesn't like to talk about it, so I won't ask what it's
doing right now. ;)

Yours

        Dirk




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to