Hi Robert and Mathias, Thanks for the anwers. Let me reassume, from my perspective, to make sure I understood correctly what the problems are.
1. There is no use in TexGen as a texture state attribute with EYE_LINEAR, because no one knows with what modelview matrix it will be applied. 2. For EYE_LINEAR one have to use TexGenNode. But its then global for whole render stage and may conflict with other TexGenNodes and TexGens as attributes if they use the same stage ... Is this correct ? Mathias, thanks for suggestions on solutions, I don't have much time for such elaborate work now. I have a conflict on 0 stage texture coords, but fortunatelly I can switch to other stages. So I will probably leave stage 0 alone and will use other stage with global TexGenNode. Thanks, Wojtek ----- Original Message ----- From: "Mathias Fröhlich" <[EMAIL PROTECTED]> To: "OpenSceneGraph Users" <[email protected]> Sent: Thursday, March 27, 2008 1:14 PM Subject: Re: [osg-users] TexGenNode vs Group with TexGen attribute 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 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

