Jump to content

  • Log In with Google      Sign In   
  • Create Account






vortxGE 2.0 Material Animation

Posted by Lee A. Stripp, 19 February 2012 · 571 views

Now I have material animation working, but as you may know there is the issue of shadow casting when animating the Alpha Chanel.. I've opted for a User setting that lets them turn ON/OFF Depth buffer writes.. I'm wondering if that is the best option, I just cant think of any simple way to adjust shadows on an object by object basis... For instance you may want shadows cast from a Quad with alpha map on it but a glowing effect that flashes just wont work.

Any inspired options anyone ?




Which issue are you referring to that's caused by animating the alpha channel?
Well with forward lighting, I'd like to match object alpha to shadow alpha. But I don't think this is possible right? I'm new to modern hardware tech, I'm reading as much as possible to catch up !
Ah, it depends on how you're rendering out your shadow pass. Like you could render out to a 2 channel 32 bit texture and write out both depth and alpha from your pixel shader, or you could render out to multiple render targets to store the additional alpha information. Though if that's too expensive, just doing a pixel kill based on a threshold value is often enough. So like if your window's transparency is less than x, kill the pixel in the pixel shader and it won't render into the shadows. Though that might look funky with the animated alpha.

Ah, it depends on how you're rendering out your shadow pass. Like you could render out to a 2 channel 32 bit texture and write out both depth and alpha from your pixel shader, or you could render out to multiple render targets to store the additional alpha information. Though if that's too expensive, just doing a pixel kill based on a threshold value is often enough. So like if your window's transparency is less than x, kill the pixel in the pixel shader and it won't render into the shadows. Though that might look funky with the animated alpha.


Hmmm.. So if I just store the alpha when rendering from the light source this is enough? I thought this would create even more problems, I guess it wont be to hard to test this out. Adding to my TODO list now, thanks buddy.
After doing some quick tests I found rendering the alpha was very expensive, I will revisit this again once I read more books, must be a better way to store alpha while storing shadowmap data.
Yeah if you do a texture sample in your pixel shader and store out just the alpha value you can use this in your shadowing code as a mask when doing your shadow calculations. What did you find was the bottleneck in your shadow pass? The texture sampling?
Well I'm rendering quite a large shadow map for testing and when I added a color texture to the FBO to store alpha it jumped from 0.6 ticks to 2.7 ticks a frame.. I'm sure with some work I can just add a alpha texture and just write to it only along with the z-depth, it was just a quick test ! When I finish my break I'll be right on this one to fix it. Thanks for your comments by the way, very helpful..

July 2014 »

S M T W T F S
  12345
6789101112
13141516171819
20212223 24 2526
2728293031  

Recent Comments

PARTNERS