• entries
    88
  • comments
    105
  • views
    70269

vortxGE 2.0 Material Animation

Sign in to follow this  
mixmaster

758 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 ?
Sign in to follow this  


7 Comments


Recommended Comments

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 !

Share this comment


Link to comment
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.

Share this comment


Link to comment
[quote name='Dancin_Fool' timestamp='1329852734']
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.
[/quote]

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.

Share this comment


Link to comment
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.

Share this comment


Link to comment
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?

Share this comment


Link to comment
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..

Share this comment


Link to comment

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