Skip to main content
GameDev.net gamedev.net
🔒 Locked

Clipping Quad ?

Started by Endemoniada Apr 19, 2012 at 10:11 PM 0 replies 1.5k views
Original Post
Endemoniada
Endemoniada
Hi guys,

I want to specify a rectangular portion of the screen to act as a clipping rect for 3D objects. I'm thinking that I can simply render a quad and set to 0 the z-values for the pixels in the quad.

I know how to render the quad of course but I don't know how to set the z-values. I'm using world coordinates for the quad.

Also, should I do this in a shader ? Please help.

Thanks.
21st Century Moose
21st Century Moose
You need scissor test. Look at IDirect3DDevice9::SetScissorRect and the D3DRS_SCISSORTESTENABLE render state.
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 

Topic Locked

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

Sign in to reply to this topic.