Hi Sandy,

You need to enable blending via a StateSet with a the GL_BLEND more
set to ON.  Do a search through the OSG examples for examples of this.

Depth sort is generally required to get good blending between objects,
and to do this you'd need to have one point per geometry, which would
be really bad for performance.  You are probably better off use a two
pass approach, once to draw fragments with an apha of 1.0 with
blending disabled, then a second pass with blending enabled but depth
write disabled.

Robert.

On 3/17/07, Sandy Patterson <[EMAIL PROTECTED]> wrote:
Hi guys,

I'm trying to figure out the point rendering example. I have written
my own reader/writer class for my point files, and I would like to
view them with point sprites (osgpoints example).

What I'm coming across is that the alpha blending from the spite
happens in the order that I've added my points into the scenegraph.

geometry->setUseDisplayList(true);
geometry->setUseVertexBufferObjects(true);
geometry->setVertexArray(vertices);
geometry->setColorArray(colours);
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
geometry->addPrimitiveSet(new osg::DrawArrays(GL_POINTS,0,vertices->size()));

Vertices and colors are osg::Vec3 and osg::Vec4ub respectively. (set
them to contain two points (0,0,0) (0,0,1)

My question is, do I have to sort the points based on z-value every
time my viewing direction changes? Or am I doing something wrong with
loading the point data. I tried to load point data with a .osg file,
but couldn't figure out the structure of the file.

Thanks a lot,
Sandy Patterson
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to