Jump to content
  • Advertisement
Sign in to follow this  
Tispe

Culling and Z buffering without using the ID3DXEffect interface

This topic is 2406 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

Hello

After reading http://www.two-kings.de/tutorials/dxgraphics/dxgraphics18.html I have implemented a Vertex Shader and a Pixel shader without using the ID3DXEffect interface. Shortly after finishing this tutorial with my project I was plagued with culling and zbuffering glitches.

Aren't Techniques and Passes a part of the ID3DXEffect interface? If so, how do I implement culling and z buffering etc without the effect interface?

Share this post


Link to post
Share on other sites
Advertisement
You could call Direct3D device's methods.
A sample below:


pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );

Share this post


Link to post
Share on other sites
I thought once you move to a programmable pipeline you forget about SetRenderState() as states are overwritten by the shader?

Share this post


Link to post
Share on other sites
No Tispe. The programmable pipeline still has certain flags and switches to do various things. I suppose in the near future even that will disappear, but for now you still have the modes and enables/disables as usual.

Share this post


Link to post
Share on other sites
SetRenderState is still needed in the programmable pipeline. Effects hides some of this for you, but it's still there.
SetSamplerState may be still used, although it may also be superseded by sampler options set in your shader code.
SetTextureStageState is removed.

Some SetRenderState calls - like lighting - are however obsoleted; most are not. You need to understand the various pipeline stages, where each state applies to each stage, and whether or not each state is superseded by the programmable pipeline (and where this is optional or mandatory).

The effects framework actually provides a wrapper around the standard Set*State calls (with the exception of SetTextureStageState) - you can see this in action (and confirm it for yourself) by creating an ID3DXEffectStateManager and examining what it does in your debugger of choice (or by using PIX).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!