What causes see through polygons?

Started by
6 comments, last by Erik Rufelt 14 years, 4 months ago
Hi guys. I am trying to render a 3d model with a shader. When I render the model, the shader seems to work correctly however I can see through my polygon. I have my cull mode set to counter clockwise and my alpha blending is turned off. Do you guys have any other ideas for what would cause the following visual artifact? Thanks in advance! http://docs.google.com/Doc?docid=0ARFEs8-zzYEmZGRqbnJ6OXZfODNkNXJubTJjZA&hl=en

xdpixel.com - Practical Computer Graphics

Advertisement
There are 2 possible explanations of error imho.

1. Model is just broken. Did you check it elsewhere?

2. Which texture format you are using for depth buffer? Error maybe due to z-fighting and it can be solved by changing this format into for example D24S8.
The model is not broken and works in other demos. I have also set my depth buffer like so in my presentation params.

m_d3dPresentParams.AutoDepthStencilFormat = D3DFMT_D24S8;

xdpixel.com - Practical Computer Graphics

Have you enabled depth testing, with pDevice->SetRenderState(D3DRS_ZENABLE, TRUE)?

It's hard to see exactly what the error might be. If it's not with the depth testing, perhaps you can post larger screenshots (like 1000x1000), and from at least two opposite angles?
It would make it much easier to see the problem.
try with culling mode as NONE

if your model appears all right with culling mode set to NONE, it might just be your NORMALS messing around. And yes, post a large res pic for better responses.
Thanks for your help. The following image is at a higher resolution.
http://docs.google.com/Doc?docid=0ARFEs8-zzYEmZGRqbnJ6OXZfODVmdjlienFmOQ&hl=en

I have my z depth testing enabled and my culling is set to none both in the shader and in my directx code.

xdpixel.com - Practical Computer Graphics

Are you clearing the depth buffer to 1?
------------------------------Great Little War Game
That is not a higher resolution screenshot, but a scaled one. If it looks like that in your program, make sure to create a back-buffer that matches a larger window. In particular we need to see if the see-through is per triangle, and if triangles are visible depending on the direction the model is viewed from. If the same triangles are always visible, the problem is that those triangles are drawn last, and that depth-testing fails to cull them. If the triangles visible depend on the viewing direction, then perhaps you have a problem with your depth-testing mode. Is it set to less, or less-equal?

Are you using the effect framework?
Do you have a z depth testing state set in the effect, or only from your program?
What is your model format?
If you try one of the models from the DirectX SDK (if they are compatible with your program), do you get the same results?

This topic is closed to new replies.

Advertisement