Hi Vinicius
I think that http://3dcgtutorials.blogspot.com/search/label/Instancing (
read from bottom to top ) explain it quite well.
you might pack positions either to Uniform Buffer Objects
layout(std140) uniform instanceData
{
mat4 instanceModelMatrix[MAX_INSTANCES];
};
or to texture, and the texture can be dynamically updated for your shader
instancing,
alternatively you might use geometry shader to generate spheres at points
of interest.
Regards
Sergey
On Sat, Nov 15, 2014 at 12:26 AM, Vinicius Schmidt <[email protected]> wrote:
> Hi Sergey,
>
> I think it's not what I need or I didn't find an example to apply to my
> problem.
>
> What I have is an array of positions, and I'm drawing the path with this:
>
>
> Code:
>
> for (int i = 0; i < dr->agents.size(); i++) {
> dr->agents[i]->getPath()->dirty();
> dr->agents[i]->getArrayLines()->setFirst(0);
>
> dr->agents[i]->getArrayLines()->setCount(dr->agents[i]->getPath()->size());
> }
>
>
>
>
> Now instead to draw the lines from position 0 to position N, I'd like to
> draw a dot or sphere in all these N positions, without line links.
>
> Could you give me some code sample?
>
> Thanks
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61648#61648
>
>
>
>
>
> _______________________________________________
> 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