Sign in to follow this  
Adaline

[DX10] Shadow maps : SetPixelShader(NULL) and Alpha test

Recommended Posts

Hello

I'm getting information on cascaded shadow maps,
and I would like to set the pixel shader to NULL because I want to manipulate directly the z buffer as a shadow map.

Is there a way to enable alpha test with the pixel shader set to NULL ? (Actually, I make the alpha test with a 'discard' when textureColor.a=0 in a pixel shader)

Thanks in advance [img]http://public.gamedev.net/public/style_emoticons/default/wink.gif[/img]

Share this post


Link to post
Share on other sites
Thank you Erik [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]

That's what I thought, I'm afraid .... I just wanted to be sure.
So I will use another texture as the render target ..... and a pixel shader [img]http://public.gamedev.net/public/style_emoticons/default/sad.gif[/img]

Share this post


Link to post
Share on other sites
[quote name='NicoLaCrevette' timestamp='1318578597' post='4872438']
Thank you Erik [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]

That's what I thought, I'm afraid .... I just wanted to be sure.
So I will use another texture as the render target ..... and a pixel shader [img]http://public.gamedev.net/public/style_emoticons/default/sad.gif[/img]
[/quote]

Hi,

you may still just write to z-buffer and disable color writes even if you use pixel shader.

For objects using alpha transparency I use a pixel shader to discard the transparent pixels and for fully opaque objects I disable pixel shader. No color buffer is needed, just the z-buffer.

Cheers!

Share this post


Link to post
Share on other sites
[quote name='kauna' timestamp='1318590067' post='4872474']
[quote name='NicoLaCrevette' timestamp='1318578597' post='4872438']
Thank you Erik [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]

That's what I thought, I'm afraid .... I just wanted to be sure.
So I will use another texture as the render target ..... and a pixel shader [img]http://public.gamedev.net/public/style_emoticons/default/sad.gif[/img]
[/quote]

Hi,

you may still just write to z-buffer and disable color writes even if you use pixel shader.

For objects using alpha transparency I use a pixel shader to discard the transparent pixels and for fully opaque objects I disable pixel shader. No color buffer is needed, just the z-buffer.

Cheers!
[/quote]

It really helps me, thanks ! I think I will try to do the same [img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img]

Share this post


Link to post
Share on other sites
Hi,

glad to be helpful. Just to clarify : by [color="#1c2837"][size=2]disabling color writes I mean that you should set your render target to NULL. [/size][/color]
[color="#1c2837"][size=2]
[/size][/color]
[color="#1c2837"][size=2]Cheers![/size][/color]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this