PolygonOffset and triangles Normals

Hi All,

The question is very simple.

Is glPolygonOffset affected by triangles normal?

The offset is done in the normal direction? Importing models with flipped normal result in hidden triangles edges?

If it is true, does anybody knows the remedy?

Thanks so much,

Alberto

It’s just an offset regarding the depth value of the polygon fragments. It happens in eye space and results depend on how the polygon is inclined regarding the view. And it has nothing to do with normals. Hope that helps.

Thanks jide,

I am wondering now, why just flipped triangles have missing borders.

I have 2 models, one with homogeneous normals and one with some normals toward the inside and some toward the outside.

The first render perfectly the second has edges only on correcly oriented normals triangles…

Mmmm… :confused:

>>It happens in eye space<<
No, further down in the pipe in window space.

Originally posted by Relic:
>>It happens in eye space<<
No, further down in the pipe in window space.

Yes you’re right.

Back to the problem, I guess it’s due to polygon orientation. Did you tried out to disable face culling ?

Originally posted by devdept:
[b]Thanks jide,

I am wondering now, why just flipped triangles have missing borders.

I have 2 models, one with homogeneous normals and one with some normals toward the inside and some toward the outside.

The first render perfectly the second has edges only on correcly oriented normals triangles…

Mmmm… :confused: [/b]
If you mean that you render wireframe edges with glPolygonMode(GL_LINE) and some don’t render, that could either be culling or lighting.
Try these experiments: disable culling, toggle glFrontFace, switch off lighting and set a different color for the edges than for the faces.

If your polygon winding is not in line with the normal’s direction, that is, the normal must always be specified on the front face in OpenGL, then all bets are off.

Yes Relic,

Disabling face culling the triangles disappear.

So do you think that glFrontFace and face Normal are not in agreement?

I’ll check!

Thanks a lot for the moment!

Alberto