Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2013-02-24 Thread Aurelien Albert
Hi, I've posted a submission which should solve this issue : http://forum.openscenegraph.org/viewtopic.php?p=52849#52849 The problem was in the ArrayDispatcher.cpp file : some kind of array types (like ArrayInt you use here) where not registered with associated dispatchers. It solves my

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-11-23 Thread Aurelien Albert
Hi, Does anyone have a solution for this issue ? Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51227#51227 ___ osg-users mailing list

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-11-23 Thread Daniel Schmid
I tried everything, it only worked with bind per VERTEX. It must be an opengl issue... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51228#51228 ___ osg-users mailing list

[osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: Code: int l_SMC = 1027; // some material code for (unsigned int i=0; ia_geode.getNumDrawables(); ++i) { osg::Geometry* l_Geom =

[osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: [code] int l_SMC = 1027; // some material code for (unsigned int i=0; ia_geode.getNumDrawables(); ++i) { osg::Geometry* l_Geom =

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Sergey Polischuk
Hi wouldnt it be better to use uniform in this case? Cheers. 24.10.2012, 13:28, "Daniel Schmid" daniel.sch...@swiss-simtec.ch:Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: [code]int l_SMC = 1027; // some

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
When I would use uniforms, I cannot set different values for different geometries. Uniforms are global for a particular stateset. So I HAVE to use vertex attributes, since in my shader I want to treat some particular surface in a special way, but without the need of separate stateset.

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tassilo Glander
Hi Daniel, you are right, with BIND_OVERALL and just one element in the array, OSG should apply the single attribute to all vertices of the geometry. You can check this behavior in Geometry.cpp searching for BIND_OVERALL. Also there is the createTexturedQuadGeometry() function which does setup

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Sergey Polischuk
Hi As you say, setting Uniforms requires a state change, while with an attribute the rendering is done at the GPU completely. it is kind of same both ways... here you need glUniform* call, there you need to bind vertex attrib and call glVertexAttribPointer* and rendering is done at the GPU

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Aurelien Albert
Hi, I think OpenGL specs doesn't allow to share a vertex attribute values between multiple vertices. Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50753#50753 ___ osg-users mailing list

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Jason Daly
On 10/24/2012 05:28 AM, Daniel Schmid wrote: Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader cannot detect it anymore. I thought i should

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tassilo Glander
Hi, sorry, I was wrong. It really seems the same in terms of state changes. A use case for a BIND_OVERALL attribute is probably that you have different types of geometry with and without individual attributes (for example color) in your scene that you want to render using the same shader.

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tim Moore
On Wed, Oct 24, 2012 at 12:37 PM, Sergey Polischuk pol...@yandex.ru wrote: Hi As you say, setting Uniforms requires a state change, while with an attribute the rendering is done at the GPU completely. it is kind of same both ways... here you need glUniform* call, there you need to bind

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Jason Daly
On 10/24/2012 11:35 AM, Jason Daly wrote: On 10/24/2012 05:28 AM, Daniel Schmid wrote: Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader