vortxGE 2.0 Material Animation

Published February 19, 2012
Advertisement
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 ?
0 likes 7 comments

Comments

Dancin_Fool
Which issue are you referring to that's caused by animating the alpha channel?
February 21, 2012 06:12 AM
mixmaster
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 !
February 21, 2012 12:17 PM
Dancin_Fool
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.
February 21, 2012 07:32 PM
mixmaster
[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.
February 22, 2012 12:56 AM
mixmaster
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.
February 22, 2012 01:40 AM
Dancin_Fool
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?
February 22, 2012 02:07 AM
mixmaster
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..
February 22, 2012 08:33 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

vortxGE : Threads

2330 views

C++11 Threads

3033 views

My Business

2189 views

Still Alive

2017 views

vortxEDIT : video

2130 views

vortxGE : Update

5980 views

vortxEDIT : Save

1889 views
Advertisement