Hi Martin, It sounds like the near plane is clipping out your fragments. The OSG by default computes the near and far planes for the scene on each frame so as you roam about the near plane can move in and out. You can disable this feature and set the near/far planes manually using:
viewer.getCamera()->setComputeNearFarMode(CullSettings::DO_NOT_COMPUTE_NEAR_FAR); Robert. On Tue, Jan 18, 2011 at 3:53 PM, Martin Haffner <[email protected]> wrote: > Hi, > > I am drawing some quads on a virtual plane to simulate raindrops on a > windshield. The drops are basically just alpha blended quads. The effect is > placed in front of the camera. It works really well, but unfortunately all my > rain drops are sometimes disappearing when I look into certain directions. > > I use a really simple fragment shader: > > Code: > gl_FragColor = v_color * texture2D(dropTexture, v_texCoord); > > > and I have discovered something interesting. If I just return the color (or a > fixed hardcoded color) the drops are ALWAYS visible. The drops are also > ALYWAYS visible when I use a hardcoded texcoord of vec2(0.5, 0.5). When I use > a hardcoded texcoord of vec2(1,1) the drops are always INVISIBLE, because the > alphavalue is 0 at the border of the texture. > > This leads to the conclusion that something manipulates the texture > coordinates of my quads. > I tried to turn off any possibly set texture coordinate matrix with these > lines: > > Code: > texMatrix = new osg::TexMat(); > osg::Matrix m; > m.makeIdentity(); > texMatrix->setMatrix( m ); > ss->setTextureAttributeAndModes(0, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > ss->setTextureAttributeAndModes(1, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > ss->setTextureAttributeAndModes(2, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > ss->setTextureAttributeAndModes(3, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > ss->setTextureAttributeAndModes(4, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > ss->setTextureAttributeAndModes(5, texMatrix, osg::StateAttribute::PROTECTED > | osg::StateAttribute::OFF ); > > > But unfortunately it did not change anything - my quads are still > disappearing depending on the camera position and orientation. > > Since I am very new to OSG I might have overseen something. Is there anything > else that could transform my texture coordinates? If yes, how can I disable > it? > > Thank you! > Cheers, > flo[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=35743#35743 > > > > > > _______________________________________________ > 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

