[osg-users] attribute variable transfers error

Robert Osfield robert.osfield at gmail.com
Thu Apr 23 01:36:28 PDT 2015


Hi Allan,

On 23 April 2015 at 02:44, allan xia <softpeo at gmail.com> wrote:
> I am sorry I did not describe the solution clearly.
> Now I need to do some extra operations in the models,so I must use shaders
> .And different models have little different operations,but mostly same
> operations, So I use the same shaders and send a flag variable to the
> shaders to judge which model the vertexs belong to. then I could solve the
> different operations. and now I use the nodevisitor to judge which model the
> vertex belongs to ,but I occur error.
> Actually the problem I need to solve is:
> how the judge which model the vertex belongs to in the vertex shaders and
> fragment shaders?

What do you mean by models in this context?

What have the vertex position have to do with the "models"?

Normally with scene graph usage a "model" would represent something
like a car, a house, or a whole town etc, and would be loaded/created
as a subgraph that gets added to the overall scene.  With each of
these subgraphs you can attach a StateSet to the topmost of node of
the subgrah, and have thes StateSet provide a specific Uniform value
that can control shaders.

Whether this is at all appropriate in your case I cannot say as I
can't work out what you might mean.

Robert.



More information about the osg-users mailing list