Hi all:

In the example of osgdrawinstances, all the coordinates are compute by the
instance id. In fact, we need all the coordinates then change the instance
to its position. I googled and find can got this by set all the coordinates
in a Texture2D. I do this by the following steps:

1.       Change the coordinates to [0,1]. 

2.       Set the coordinates to the texture image buffer.

 

In the shader I use texture2D function get the coordinate by the
gl_InstanceID, then change it covert to 1 step above.

 

The question is: I find the coordinates are not very right, am I wrong?

 

Cheers,

xianfa

 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to