Re: [osg-users] osg_Vertex with GL compatibility profile

2016-09-18 Thread Robert Osfield
On 17 September 2016 at 18:39, Sebastian Messerschmidt
 wrote:
> Hi Ravi,
>
> Thanks Robert!
>
> So do you know why using osg_Vertex works *without* using
> setUseVertexAttributeAliasing() on so many machines? I am compiling OSG with
> GL2 (no GL3 flags) on all machines. Is it just "undocumented behavior"?
>
> That is probably simply by chance, since the vertex attribute is usually the
> first one in the stream. The compiler will map the first attribute there. So
> basically this works most of the time.

This sounds plausible.

> Next question: if I use setUseVertexAttributeAliasing, then many of my
> textured polygons (e.g. Sphere) have what appears to be a flat color on
> them. The actual color used seems to be related to one point on the texture.
>
> I see similar behavior if I run the "osgvertexattributes cow.osg" example
> (see attachment). Is Vertex Attribute Aliasing something that's only
> intended for GL3?
>
> The cow model might not have texture coordinates but generated texture
> coordinates. I can't test the example right now, but maybe this is the
> reason. Usually when you go with vertex attribute aliasing you need to use
> an appropriate shader for the data.

The cow.osgt uses tex gen to generate the texture coordinates.

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


Re: [osg-users] osg_Vertex with GL compatibility profile

2016-09-17 Thread Sebastian Messerschmidt

Hi Ravi,

Thanks Robert!

So do you know why using osg_Vertex works *without* using setUseVertexAttributeAliasing() 
on so many machines? I am compiling OSG with GL2 (no GL3 flags) on all machines. Is it 
just "undocumented behavior"?
That is probably simply by chance, since the vertex attribute is usually 
the first one in the stream. The compiler will map the first attribute 
there. So basically this works most of the time.


Next question: if I use setUseVertexAttributeAliasing, then many of my textured 
polygons (e.g. Sphere) have what appears to be a flat color on them. The actual 
color used seems to be related to one point on the texture.

I see similar behavior if I run the "osgvertexattributes cow.osg" example (see 
attachment). Is Vertex Attribute Aliasing something that's only intended for GL3?
The cow model might not have texture coordinates but generated texture 
coordinates. I can't test the example right now, but maybe this is the 
reason. Usually when you go with vertex attribute aliasing you need to 
use an appropriate shader for the data.


Cheers
Sebastian


Ravi

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68641#68641





___
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] osg_Vertex with GL compatibility profile

2016-09-17 Thread Robert Osfield
Hi Ravi,

If you want to use osg_Vertex then you'll need to
setUseVertexAttributeAliasing().

Robert.

On 17 September 2016 at 04:26, Ravi Mathur  wrote:
> Hi all,
>
> I see some behavior that I don't understand when using the osg_Vertex shader 
> attribute across various graphics cards. Hopefully someone can shed some 
> light.
>
> I am enabling OSG uniforms using 
> GraphicsWindow->getState()->setUseModelViewAndProjectionUniforms(true). Then, 
> in my vertex shader, I use osg_ProjectionMatrix and osg_Vertex. Note that I 
> don't call State::setUseVertexAttributeAliasing().
>
> Everything works fine on many graphics cards, but on some cards my vertex 
> shader behaves as if osg_Vertex is undefined. It doesn't give any errors, 
> just produces results as if the vertex is zero. This only seems to happen 
> with graphics cards where the renderer reports "OpenGL 4.1 Compatibility 
> Profile Context". Examples are ATI Radeon HD 5450 and AMD FirePro V5900 cards.
>
> Any ideas on what I'm missing here?
>
> Thanks!
> Ravi
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68633#68633
>
>
>
>
>
> ___
> 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] osg_Vertex with GL compatibility profile

2016-09-17 Thread Ravi Mathur
FYI, my vertex/fragment shaders are using #version 120 because they need to be 
compatible with OSX X11 (XQuartz). I have noticed that even on the graphics 
cards with the compatibility profile (windows machines with certain ATI/AMD 
cards), directly using gl_Vertex instead of osg_Vertex seems to fix the 
problem. In other words, my call to glVertex3f() seems to correctly set 
gl_Vertex, but not osg_Vertex, in the vertex shader.

I am pretty new to GLSL, so I feel like I'm missing some core concept related 
to GLSL and compatibility profiles.

Thanks again,
Ravi

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68634#68634





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


[osg-users] osg_Vertex with GL compatibility profile

2016-09-16 Thread Ravi Mathur
Hi all,

I see some behavior that I don't understand when using the osg_Vertex shader 
attribute across various graphics cards. Hopefully someone can shed some light.

I am enabling OSG uniforms using 
GraphicsWindow->getState()->setUseModelViewAndProjectionUniforms(true). Then, 
in my vertex shader, I use osg_ProjectionMatrix and osg_Vertex. Note that I 
don't call State::setUseVertexAttributeAliasing().

Everything works fine on many graphics cards, but on some cards my vertex 
shader behaves as if osg_Vertex is undefined. It doesn't give any errors, just 
produces results as if the vertex is zero. This only seems to happen with 
graphics cards where the renderer reports "OpenGL 4.1 Compatibility Profile 
Context". Examples are ATI Radeon HD 5450 and AMD FirePro V5900 cards.

Any ideas on what I'm missing here? 

Thanks!
Ravi

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68633#68633





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