occluding back face

Started by
14 comments, last by steg 20 years, 11 months ago
I've included a link to the demo code for the terrain if you are interested ?

Camera controls are cursor keys, put num lock on to use keys 8 for up, 2 for down, 4 straif left, 6 straif right.

Same url : http://www.golfinabag.com

Kind regards,
Steve



As I get older, my mind becomes more cluttered.

[edited by - steg on May 9, 2003 7:08:10 AM]

If it isn't working, take a bath, have a think and try again...

Advertisement
Thats looks fine to me.
So, it worked ok ? It should be like that ?

Kind regards,
Steve


As I get older, my mind becomes more cluttered.

If it isn't working, take a bath, have a think and try again...

yeah. basically, the triangles you see at the back are actually front-facing. ...All that rage, for nothing!

They are just masked by the triangles at the front when drawn with fill mode. In wireframe, all the renderer do is draw lines, and use the Zbuffer on the pixels of the line, not the triangle surface. to mask the polygon at the back in wireframe, you''d have to first render the terrain with totally black polygons, then render the wireframe on top of it with a glPolygonOffset(). And that''s if you have a black background.

If you want to cull the polygons at the back more efficiently, you''ll need more than backface culling. you''ll need occlusion culling.

Everything is better with Metal.

Thanks oliii!

If it isn't working, take a bath, have a think and try again...

actually im not so sure its all ok...
when you enable wire frame rendering, the scene is still rendered per triangle, and of each triangle, each edge is draw as a line. if you would enable backfaceculling, all backfaceculled tris would fall away and thus you should not see them.
i think the problem is in your triangle strips: try rendering your triangles shaded: probably your terrain shows a checkered pattern now: it looks like there is no backfaceculling cos every other tri is drawn, witch doesnt show up cos each edge is shared by two tris.. at least thats what has happended to me, using dx btw.
if this is the case, to overcome this, you should flip the normals of every other triangle strip.

This topic is closed to new replies.

Advertisement