For the record, with a little editing one can make any OSG object
transparent
Here's a modified state set that makes the dump truck work with the osgoit
demo. I added blending, moved everything to TRANSPARENT_BIN and changed the
alpha settings in the material. And then it works as expected in the osgoit
viewer.

      StateSet {
        UniqueID StateSet_1
        DataVariance STATIC
        rendering_hint TRANSPARENT_BIN
        renderBinMode INHERIT
        GL_CULL_FACE OFF
        GL_LIGHTING ON
        GL_BLEND ON
        BlendFunc {
            DataVariance STATIC
            source SRC_ALPHA
            destination ONE
        }
        Material {
          DataVariance STATIC
          ColorMode OFF
          ambientColor 0.2 0.2 0.2 0.4
          diffuseColor 0.8 0.8 0.8 0.4
          specularColor 0 0 0 0.4
          emissionColor 0 0 0 0.4
          shininess 0
        }
      }

I would find the osgoit demo more useful if it had a command line switch to
override the material settings and blend function of the loaded model, so
one can run this with the vast majority of existing OSG models from the
default data directory.

I will now try to understand the osgoit code and then try to roll my own
implementation of either the dual depth peeling code, or the weighted
average method from the nVidia paper.

The reason is that I will have to show some transparent buildings in our
radio simulator and once we start adding some interior walls to the
geometry, things become too complicated for the simpler algorithms. Depth
peeling seems to be the way to go for us.

Thank you for providing the osgoit demo!


2013/2/19 Mathias Fröhlich <[email protected]>

>
> Hi,
>
> On Monday, February 18, 2013 15:56:02 Christian Buchner wrote:
> > does osgoit require the loaded 3D model to be transparent already?
> What do you mean?
> If parts of your model are not transparent they should not render
> transparent?
> Right?
>
> > I remember that I was able to run osgdepthpeeling with the dumptruck
> model
> > successfully, but with the osgoit sample I can't get this to render any
> > transparency at all.
> It did for me the other way round. I never saw something sensible with
> osgdepthpeeling. But loading a model with transparent triangles renders
> fine
> with osgoit. At least the ones that I usually tried.
> Only if your model contains protected state attributes that need to be
> overwritten this can hurt. Especially the blend mode need to be overruled
> by
> the viewer code.
>
> For the zurich paper, I also read that. IIRC the loaded model needs to have
> all the state replaced by the viewer codes for multiple render targets
> which
> makes all the colors and textures and whatnot just disappear or requires a
> lot
> work to translate that.
> That simpler algorithm does not need any cooperation from the model except
> the
> blend state must not be protected.
>
> So it's about to view a model just like it would look like with osgviewer
> but
> with correct(er) transparency.
>
> Greetings
>
> Mathias
>
>
> _______________________________________________
> 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

Reply via email to