# Z Only

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

## Recommended Posts

I'm having problems with my Z Only pass in the beginning of my frame. It should ( as you all propably figured out ) render the Z Value to the Z Buffer ( thereby making it easier for me to reduce overdraw ). Now, I'm currently using shaders to do all my statechaning and my ZOnly technique looks like this :
        ZEnable          = TRUE;
ZWriteEnable     = TRUE;
StencilEnable 	 = FALSE;
ZFunc		 = LESSEQUAL;

ColorWriteEnable = 0;

CullMode         = NONE;


After doing that most of the pixels that I draw are not visible... Here is the normal rendering I do after the Z Only ( the renderstates that is)
        ZEnable          = TRUE;
ZWriteEnable     = FALSE;
StencilEnable 	 = FALSE;
ZFunc		= EQUAL;
AlphaBlendEnable = FALSE;
ColorWriteEnable = RED|GREEN|BLUE|ALPHA;
CullMode         = CW;


If I disable the Z Only pass my geometry is displayed perfecly so it should be a renderstate error, I'm curious if ColorWriteEnable dosen't work like I use it, I've tryed doing it another way, by Enabling ColorWrite (all channels) and using these renderstates instead :
      	AlphaBlendEnable = TRUE;
SrcBlend				 = ZERO;
DestBlend				 = ZERO;

But it dosen't seem to work any better ( acctually If i enable the last code and do only the ZOnly pass it acctually draws alots of pixels (even though they it was mean't not to)

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633317
• Total Posts
3011336
• ### Who's Online (See full list)

There are no registered users currently online

×