Skip to main content
gamedev.net
🔒 Locked

Culling

Started by Dovyman 1 reply 200+ views
Original Post
Dovyman
Dovyman
I was just curious, I know theres a setting for backface culling in DX, but when on does it do it all for you automatically.. is there anything else required to do for backface culling?
S1CA
S1CA
The only prerequisite for backface culling is that the vertices or indices (if you''re using indexed primitives) are defined in such a way that the winding on all the faces is clockwise (if you use D3DCULL_CCW, i.e. cull anything which is counterclockwise). D3D (actually the hardware which D3D exposes) uses only the order that the vertices are fetched in to cull, no need for normals etc.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
rawsoft
rawsoft
just to complete the circle to do culling in dX9 using C# you will have to set your Device Renderstate.Cullmode property to what ever you want, actually there are only three, clockwise,counterclockwise, and none which means you can turn it off.

Example
===============
Devicename.RenderState.Cull.Clockwise;
Devicename.RenderState.Cull.CounterClockwise;
Devicename.RenderState.Cull.None;


you will have to changed "Devicename" to the appropriate name that you are using.




dotnet Programmers Network
www.programmersnet.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.