Hello Wojtek,

Hence I would only leave setLight( osg::Light * ) method.

Ok, thanks for explaining, makes a lot of sense.

Feel free to post submission adding this method when Robert finally
adds my code to OSG ;-) I won't be offended and I hope You are not offended
now when I object to add setLight( osg::LightSource * )  method ;-)

I am not offended at all, and I will not submit such a fix unless I can also guarantee that the LightSource will be tracked correctly if it changes. I agree with your arguments.

Proper implementation will probably require modifing shader
source on the fly using sprintf before application (unless its not possible
to pass gl_TexCoord  indices as uniforms, which I believe is not in  GLSL).

It might depend on the GPU version/driver, but I use that (uniforms for texture unit numbers) in our shaders here so it should work. But I think you're right, using sprintf would make sure there won't be any problems with different hardware, and since the setTextureUnit methods are not called often, it can just generate the shader at that time. Another solution would be using two shaders, the first one using #define for the texture unit numbers and then the second using the defined values. That would mean that the main shader would stay the same (could be very complex if we want) and the shader that defines the texture unit values would be very simple and quick to generate.

It would be interesting in the future to have an osg::ShaderUtilities class for managing such things as generating shaders with parameters, or things like that.

You may try deriving LispSM from MinimalCullBoundsShadowMap and see if it
changes anything. Or wait for my next submission, soon, and test all three
variants.

I saw your other message with the new version, I'll try that when I can.

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to