I've encountered the same problem, and setting the
context-getState()-setUseModelViewAndProjectionUniforms(true);
for each context didn't work in any case (with a multi-pass offscreen
rendering).
So the simple solution for me was to use the #version 150 compatibility
profile, which let's you
J-S,
Thanks for the reply.
I hadn't sat down and compared matrices yet, but I had debugged to ensure I was
getting something. And yes, I'm accommodating for the fact that it's a
ModelView (and not just a Model) matrix. I've also been using the osg_
attributes to this point, in lieu of the
Hi Joel,
So far as your optimization tip goes, I assume you're meaning to apply the
shader at the transform node as well? I've been doing that sort of thing
already, just not on my Transform nodes...
No, I mean that all non-Transform children under a Transform will have
the same
J-S,
Of course. It's not that I didn't know state is inherited by child nodes, but
for some reason, my testing of uniform inheritance failed, so I was manually
propagating uniform pointers... Took 30 seconds to disable that code and prove
your point. Thanks again.
- Joel
Hi,
I'm implementing shaders in GLSL 140+ (i.e. no built-in uniforms), and I've had
reasonably good success thus far. However, it's quite obvious that passing the
vertices in using osg_Vertex doesn't include any transformations which may have
been inherited (or directly applied).
This exact
Hello Joel,
It seems apparent that I need to multiply the osg_Vertex vector in my vertex
shader with the model matrix for that geometry (via a uniform updated every
frame, or at least whenever the geometry is transformed). The only function
that I've found that may get the model matrix is
Hey, thanks for the fast response...
What you're suggesting I actually tried. The View matrix was intact, but the
transformations were not. So far as I can tell, my understanding matches what
you're telling me, but just to be sure, I've assumed the following:
1. The CullVisitor function,
7 matches
Mail list logo