Hello,

On Tue, 2014-06-03 at 17:32 +0200, Johannes wrote:
> Hello Gerrit,
> 
> On 03.06.2014 13:44, Gerrit Voß wrote:
> >
> > could you send me an osg file dump of the scene graph for the 1_x sequence
> > of images. I'll try to recreate the problems, but it might be easier having 
> > a
> > reference to see the actual setup.
> >
> I have uploaded the files to
> 
> http://www.filedropper.com/error

thanks, with shaders I'm seeing a the same flat appearance on ATI
cards and correct shading on NVidia card.

ok, beware, we are entering the murky waters of vertex attribute 
aliasing. Which IMHO causes the main problems between NVidia and ATI
hardware/drivers in your case, and in general. As far as I understand
it, when using vertex attributes with shaders in an any kind of
compatibility profile (I'm counting #version 120 as one) only
gl_Vertex/location 0 is guaranteed to alias correctly. All the others
might (NVidia) or might not (ATI), were should not is correct according
to the spec. Also, in compat mode you can't bind anything explicitly to
location=0 in your shaders, so here comes the 'ugly' mix.

Could you try the following vertex shader for your setup, which 
makes use of gl_Vertex being aliased and the normal being explicit
specified. 

//#version 150 compatibility
//#extension GL_ARB_explicit_attrib_location : enable
// or
#version 330 compatibility

out vec3 vTranfNormal;
out vec4 vPosition;

layout(location = 2) in vec3 glNormal;

//
// Compute the normal
//
vec3 fnormal(void)
{
    vec3 normal = gl_NormalMatrix * glNormal;
    normal = normalize(normal);
    return normal;
}

void main()
{
    gl_Position   = ftransform();
    gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
    vTranfNormal  = fnormal();
    vPosition     = gl_Vertex;
}


Could you try this one and let me know if it solves your display
problems. If you need more attributes (colors/tex coords) you have
to provide the corresponding layout statements in your shader.


Coming back to another point in the thread:

OSG_ENABLE_NEW_GEOHANDLER=ON

I finally fixed to OSB loader problems (a while ago), so this option
will disappear rather soon and the =ON case will become the only
available option.

kind regards
  gerrit





------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to