Advertisement

Semi Transparent Billboards and Shadow casting

Started by June 28, 2018 09:36 PM
2 comments, last by ErnieDingo 6 years, 7 months ago

HI,

Needing some advice on a feature of the pixel shader that can be leveraged when making a shadow pass.  Currently, my shadows work fine, everything is quite happily working....I did though ignore one aspect and I should of fixed it that point in time, for things such as billboard particles I'm no rendering shadows.  The reason at the time was that the entire billboard (including what would of been the transparent area) is being written into the depth buffer.  I remember seeing on the forum and answer to this problem , I believe it was to attach a pixel shader.  And for pixels that weren't rejected on the depth test I believe I need to set the return value to null?  @Hodgman - I know you were involved in the thread, you might be able to throw some light on this :) I believe if the texture sample is transparent then I should call discard?

I've trawled the web site for the answer (and it's in here, i know it, i've seen it), Just hoping for a quick answer on something that is a little bit obscure.

Time for me to go back and fix this little issue.

Thanks all

 

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

I already answered you in the chat, but for future googler's sake - yeah, if you want to use a PS but not actually render to a color target, you can return void from your PS function. Inside the PS, you can read your texture and discard/clip if the alpha is less than 1.0 (or some other threshold).

Advertisement
1 hour ago, Hodgman said:

I already answered you in the chat, but for future googler's sake - yeah, if you want to use a PS but not actually render to a color target, you can return void from your PS function. Inside the PS, you can read your texture and discard/clip if the alpha is less than 1.0 (or some other threshold).

Thanks bud, saw that after.  Discord isn't the best medium, should of posted here firstly!  So know I could get you here.  Thanks for the info.  Definitely one of those little things that are useful.

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

This topic is closed to new replies.

Advertisement