[osg-users] Passing dae data in shader.

2012-03-26 Thread Peterakos
Hello.

Is there any way using the dae plugin in osg, to pass the vertices in
shader code as attributes?
What i do now for simple geometry shapes (lets assume we have a quad), is
to use

setAttributeValues( ... ); passing the vertices' positions, colors normals
etc.
How can i get this information from a dae file and use the same shader?

Thank you.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Passing dae data in shader.

2012-03-26 Thread Christian Buchner
I'd say you would have to modify the DAE reader according to your
shader's needs, or alternatively you'd need to do some postprocessing
on the returned geometry.

I would think that modifying the reader might be easier than
processing its generated output.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Passing dae data in shader.

2012-03-26 Thread Peterakos
Hello.

Is there any Sample/Example for this ?

Thank you again.

On 26 March 2012 15:00, Christian Buchner christian.buch...@gmail.comwrote:

 I'd say you would have to modify the DAE reader according to your
 shader's needs, or alternatively you'd need to do some postprocessing
 on the returned geometry.

 I would think that modifying the reader might be easier than
 processing its generated output.

 Christian
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Passing dae data in shader.

2012-03-26 Thread Jean-Sébastien Guay

Hi Christian,


I would think that modifying the reader might be easier than
processing its generated output.


I would say the opposite - creating a NodeVisitor that you run over the 
loaded graph, which will massage the data to suit your needs, would be 
easier than modifying the reader plugin. The NodeVisitor you can write 
knowing only OSG and OpenGL. The reader plugin you need to also know the 
source format and idiosyncracies of it, which in the case of DAE could 
be opening a whole can of worms.


As an added benefit, you can even write your NodeVisitor such that it 
will be as general as you want. It could be able to post-process any 
loaded scene graph, independently of the original format, because it 
takes as input any OSG graph. Whereas modifying the reader would give 
you the expected result only with one file format; if you want to get 
the same results with another format you need to re-do all your 
modifications in that other reader plugin...


In the past I've written a NodeVisitor that eventually gave data 
structures renderable in DirectX, and in pure OpenGL without using OSG 
as the render backend. Writing such a visitor is not too hard, and it's 
easy to debug too.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay  jean_...@videotron.ca
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org