Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Hidden face removal?

This topic is 5600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
D3DRS_CULLMODE = D3DCULL_CCW

Tends to do the job nicely - and is hardware accelerated the majority of the time. There hasn''t been much point in culling yourself for around 5 years now.

The only times you''d want to do it manually would be:

a) if you''re writing a software engine (if so why the DX forum?)

b) if you can do it faster than the custom graphics hardware can - if any method you find involves doing any maths with individual vertices or polygons, forget it, you''ll be slower than hardware!. About the only methods with any life left in them are those which can cull off say 100 back facing polygons in one go with a few simple operations. Preferably also not leaving holes in your vertex data AND not dereferencing via your index data for every face (hints at some amount of pre-sorting/classification).

c) you''re coding for a platform where you do this kind of stuff manually.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i think he meant...

say you have two 3d boxes. box A and box B.

box B is behind box A and so you can''t see box B.
you wouldnt need to draw box B.
how would you not draw box B?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
i think he meant...

say you have two 3d boxes. box A and box B.

box B is behind box A and so you can''t see box B.
you wouldnt need to draw box B.
how would you not draw box B?



Ah - wrong terminology then, hidden face removal is also known as backface removal or backface culling (i.e. the face has its back to the viewer so it is culled/removed).

What you describe is "object occlusion"/"occlusion culling" which is quite a big and deep topic. Far too deep to give a complete tutorial style post here.

In DirectX 9, you can render low detail versions of your geometry and use D3DQUERYTYPE_OCCLUSION with IDirect3DDevice9::CreateQuery to create an asynchronous query to see if one gets occluded. [similar idea to OpenGL occlusion query extensions].

An excellent place to get a lot of information is to downlad the dPVS reference manual from http://www.hybrid.fi/dpvs.html (Hybrid are the company who''s Umbra technology forms RenderWare dPVS).

The PVS in the name of that is another method of occlusion culling known as Potentially Visible Sets where you store information about which objects are visible from the viewpoint of other objects in the scene.

General higher level object culling (none of which is API specific) also goes further in each direction - for example a quadtree describing a city with octrees for building sections, cell-portal and PVS schemes for rooms and floors, occlusion culling (such as HOMs clipped by portals) for objects in the room etc.

I''m not sure if the demos are still available to download from the Hybrid site, but they''re quite impressive and let you see how various techniques affect the framerate/what gets rendered.

500 500 500 500 500 500

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!