Culling Issue

Started by
8 comments, last by wodinoneeye 17 years, 6 months ago
Lang: C++/DX9 Culling: CCW Problem: When I render the level's polygons, and the camera is set looking down at the level from the left hand side, all the polygons and their textures displayed. But now when the camera is set to look down at the level from the same height but from the right side, some of the polygons are being displayed. I notices that it deals with the culling method I'm using. If I set culling to none, then all the polygons are rendered, which is correct. But when looking down and from the right with culling set at clockwise, then those non-rendered polygons are displayed and all the rest are not displayed. I was curious as to what I can do to solve this problem. One person metioned to me to Just render all the polygons in clockwise and counter-clockwise rotation so that I can be 100% positive that all the polygons will be displayed. This method works, but I don't think this is a good method because I'm displaying the level once in CCW and again in CW. Does anyone have any other solutions? Thank you ahead of time.
Advertisement
Sounds to me like you've got some issues with your level. Is this a full 3d model type structure, that has different back and front parts, or is it just made up of thin walls?

Seem that some triangles are either missing, or have a flipped order. If the order is flipped, either those triangles will need to be corrected, or you could just use D3DCULL_NONE, and suffer somewhat of a performance impact. If triangles are missing, they'll need to be added to the level.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
I don't know if this helps, but the Polygons that aren't showing but showing in one direction are the polygons that are standing upright on the z-axis (like for example the the right-wall side of a cude).

p0.x = cp.x + width; p0.y = cp.y; p0.z = cp.z;
p1.x = cp.x + width; p1.y = cp.y + height; p1.z = cp.z;
p2.x = cp.x + width; p2.y = cp.y + height; p2.z = depth;
p3.x = cp.x + width; p3.y = cp.y; p3.z = depth;
Would it be bad for me to state culling to none (I always that that cull none was bad), or are you saying that when I'm rendering those few selected polygons, I should set the cull mode to none, and have the rest at CCW (which works good)?
Quote:Original post by LostSource
Would it be bad for me to state culling to none (I always that that cull none was bad), or are you saying that when I'm rendering those few selected polygons, I should set the cull mode to none, and have the rest at CCW (which works good)?


Theres nothing wrong with using D3DCULL_NONE, other than that you lose the benifits of culling. If you want all triangles to be visible from both sides, using it would be a good idea.
Sirob Yes.» - status: Work-O-Rama.
"you lose the benifits of culling", would those benifits greatly slow down the framerate, or am I still in the clear.
Quote:Original post by LostSource
"you lose the benifits of culling", would those benifits greatly slow down the framerate, or am I still in the clear.

That really depends on the situation. It might make 0 difference, but it might also cause a 50% drop (that's very unlikely). Just try it and see what happens.
Sirob Yes.» - status: Work-O-Rama.
Thanks guys for the help on this topic. It really helped me out.
We cannot tell you how much it will slow do YOUR application. It's called profiling. It takes 2 seconds to change this param and recompile. See what it does.

Rant: Why do people wait possiblity hours for a reply when 2 minutes of actual work will give them the answer? Lazy programmers write sloppy/bad code. Break the habit of asking for help until you've spent about 10 hours on something. If your new this is the BEST asset you can develop. Over time it will take far less time to get the info you want.
Quote:Original post by Anonymous Poster
We cannot tell you how much it will slow do YOUR application. It's called profiling. It takes 2 seconds to change this param and recompile. See what it does.

Rant: Why do people wait possiblity hours for a reply when 2 minutes of actual work will give them the answer? Lazy programmers write sloppy/bad code. Break the habit of asking for help until you've spent about 10 hours on something. If your new this is the BEST asset you can develop. Over time it will take far less time to get the info you want.




It doesnt always work the same on different Graphics cards.

Some might handle the drawing diferently and short circuit the processing sooner than others (The pixel processing being skipped if the Z buffer value is already higher -- IF in z buffer mode OR depending on the Operations specified by the shader.....)

Though it might indicate possible degredation of performance.....

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement