I'm working on a shader that runs two passes:
- A standard vertex / pixel shader that draws the original object with some alpha blending
- A geometry shader that subdivides the mesh and makes it crumble
My issue however is that the geometry of the first pass occludes the geometry of the second pass. Even when the original geometry is fully transparent, it completely culls whatever geometry from the second pass is behind it. The original geometry is a sphere, which as you can see here occludes the result of the geometry shader
The first pass uses this blending mode:
BlendState SrcAlphaBlendingAdd
{
BlendEnable[0] = TRUE;
SrcBlend = SRC_ALPHA;
DestBlend = INV_SRC_ALPHA;
BlendOp = ADD;
SrcBlendAlpha = ZERO;
DestBlendAlpha = ZERO;
BlendOpAlpha = ADD;
RenderTargetWriteMask[0] = 0x0F;
};
both passes currently use this depthstencilstate:
DepthStencilState Depth {
// Depth test parameters
DepthEnable = true;
DepthWriteMask = all;
DepthFunc = less;
StencilEnable = false;
};
Cullmode is set to NONE for both passes.
Is there a way for both passes to use depthtest, without the first pass occluding the second?
If need be I can separate these passes into two shaders and just render the same object with both shaders in engine, but I would like to figure out if it's possible just using multiple passes.