On Fri, Oct 26, 2012 at 6:17 AM, Christoph Heindl <
christoph.hei...@gmail.com> wrote:

>
>
> On Thu, Oct 25, 2012 at 9:32 PM, Glenn Waldron <gwald...@gmail.com> wrote:
>
>> I would try multipass rendering first. It is likely to be the slowest,
>> but also probably the easiest to implement and you don't have to worry
>> about exceeding your hardware limits. This falls into the category of "just
>> get it working" and then worry about optimizing it later if necessary. Who
>> knows -- maybe the performance will be acceptable.
>
>
> How would I go about this? I assume I'd need to enable different textures
> on each pass. How the pass the UV coordinates (as different sets)?
>
>
Right. So for multipass in general, you have a root node; then under that
node there is one Group node per pass; then all these Group nodes share a
common child (the geometry to render). Each per-pass Group node can hold a
unique StateSet that assigns the proper texture, etc.

Since you will also need to use the TexGen capabilities (discussed earlier
in this thread) to generate the correct texture coordinates for each pass,
you might use an osg::TexGenNode in place of the osg::Group. TexGen will
generate the UV coordinates for you.

You might also look at the osgFX::Effect class. This is a framework for
rendering a subgraph multiple times (multipass), using a separate StateSet
for each pass (just what I described above) so it might be a good fit, or
at least good reference material.

HTH.

Glenn Waldron / Pelican Mapping / @glennwaldron
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to