Carsten Neumann wrote: > Michael Babcock wrote: >> I'm having a problem with a GLSL shader. It works fine for opaque >> objects, but transparent objects don't look right. I tracked it down to >> my use of the OpenSG uniforms OSGWorldMatrix and OSGTransInvWorldMatrix. >> It appears these variables contain garbage or out-of-date values for >> transparency sorted objects. >> >> If I setSortTrans(false) on the render action, the shader works >> correctly, but of course transparency isn't rendered correctly in this case. >> >> Any ideas why this might be the case? > > very strange, I just checked the code in the RenderAction that updates > the matrices and it is the same for transparent and opaque objects. I > don't know in what context you are using this and how much work it is, > but would it be possible for you to create a small (like the testFoo.cpp > ones) program that shows the behavior ? > Alternatively, can you run your code in a debugger with a breakpoint > being set on void RenderAction::updateShader(State *state) and see if it > gets called before each object that is being rendered with your shader ?
I haven't yet been able to re-create the issue on a simple scene, only on a rather large scene. I have found one further hint, though: the problem only occurs if FrustumCulling is turned on. Transparent objects usually look okay, but at certain viewing angles they go dark. This is strange because I verified the problem with a shader that does not depend on the ViewMatrix, only the WorldMatrix. ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
