Spellcaster Studios

Make it happen…

Alpha test on shaders

As I mentioned yesterday, because of the way I’m doing the alpha-testing, if I want to place the depth on the alpha channel of the render target that I’m using for the screenspace effects, I need a way to keep the alpha testing, but don’t use the end result of the rendering for it…

If I just plug it in, I get this:

screen373

The results get all wrong because I do alpha test using the depth of the pixel, and not its alpha value.

Well, shaders to the rescue… After some work today, the system now does the alpha testing on the shader itself, instead of using the “normal” way:

screen374

The trees are showing up with the distance because I’m using the depth as the alpha on the rendering, but you can see the contours of the trees correctly instead of just quads, so it’s working properly.

Here you can see another shot from first person perspective:

screen375

Now, I need to put the result of this render into an offscreen buffer with larger precision, instead of the screen, and I can start using this buffer as a source of data for the ambient occlusion.

Now listening to “Upon Haunted Battlefields” by “Thaurorod”

Comment