Hi,

On Thursday 27 March 2008 12:00, Wojciech Lewandowski wrote:
> I think I understand these nuances when it refers to TexGenNode. But what
> bothers me is a question what modelview matrix  is used while applying
> TexGen to OpenGL when I use TexGen as an attribute ? Is this the modelview
> that CullVisitor accumulated when processing the group with texgen state
> attribute ? Or is it a "random" modelview which is current when render
> stage aplies texgen attribute before rendering renderleafs using this
> stateset ?
You cannot rely on a specific modelview matrix to be applied when these 
attributes are applied.

What you can do is to fiddle with draw callbacks in render stages and 
additional render stages that you introduce in the cull callback to make that 
work with the current code.
I do so with flightgear and clip planes.
That does not work in every case and raises the need to habe a well defined 
render bin hierarchy around that nodes, but it works well enough.
See SGClipGroup in SimGear (www.simgear.org) ...

> I wish to use TexGen as attribute because TexGenNode behaviour seems
> globally superfluous. Tex coords are generated for children as well as
> sibling subgraphs of  TexGenNode (I am not sure what about ancestors). I
> would rather want to limit tex coord generation to children subgraphs. But
> I can't sort out how to modify texgen matrix to produce exactly the same
> coords as TexGenNode used to...
Yep, I would like to do so too.

And I would like to do so without the need to introduce a new render stage for 
that.

> Few more questions: what happens if I set two or more TexGenNodes on the
> same stage somewhere in the graph. Is it allowed ? What will be their scope
> ? And what happens if there is TexGenNode and some other node with TexGen
> attribute on the stateset ?
Well you can, but the behaviour ist undefined I believe :).
It depends on which TexGen Node you enter last when you do the cull traversal. 
It depends how much stateset chareing you do, that is it is affected of the 
state grap that is built in the rendering backend and so on ...

I was thinking about solutions to that problem several times now. But I did 
not see something really valuable up to now ...

GReetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to