Skip to main content
gamedev.net
🔒 Locked

Z Pass

Started by carew May 29, 2009 at 1:56 PM 3 replies 1.6k views
Original Post
carew
carew
Hi, I'm looking for the best method of first, quick pass - Z-Pass. Current I do it: 1 . - Disable color write - Enable write to Z-Buffer - Render scane - Disable write to Z-Buffer - Enable color write 2. - Render scene with shaders (pixel shader executing is short, because many pixels are rejested in first Z-Pass) Can do this pass in other, best way? Eg with usage shaders in "1." Z Pass?
osmanb
osmanb
No, this is basically the best way. Rendering with color writes turned off will actually make things render much faster on many cards (they get higher fill rate if you're only rendering depth). The whole idea is to have your Z buffer filled in so that your shaders don't run on as many pixels, so you can't really do it in one pass.

Is there a specific problem that you're having, or are you just wondering about alternatives?
MJP
MJP
Yeah, what you're doing there is fine. Just make sure for your Z-only pass you use as simple a shader as possible.
Atrix256
Atrix256
Hey, I don't want to toss this thread OT but I'm a generic game programmer with very little knowledge of graphics programming issues (such as this one)

anyone know any good books?

(again sorry for going OT but this is the exact kind of thing i am trying to learn more about)
carew
carew
Very thanks :)

Topic Locked

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

Sign in to reply to this topic.