Game Development Community

Shadow fade (reverse ?)

by Hewster · in Torque 3D Professional · 06/15/2009 (9:52 am) · 8 replies

I have commented on this "feature" a few times, but have decided to make a dedicated
post about it.

In Advanced lighting (Sun) the shadow at the base of an object is fainter than the top:

www.aev-uk.com/sites/hewster/forum_stuff/T3D/beta2/images/Beta2_sun-shadow_01.jpg

This also means we get apparent light bleeding:

www.aev-uk.com/sites/hewster/forum_stuff/T3D/beta2/images/Beta2_sun-shadow_02.jpg

I can get rid of this problem by upping the "overdarkfactor" to say
9000 7000 6000 5000
But this then causes its own problems (I can expand on this if needed)


My question is, to Tom I guess... Is it possible to reverse this shadow fading ?
I think it would look more realistic if the "end" of the shadow is fainter than
the "base"

Cheers,
Hewster.

#1
06/15/2009 (10:40 am)
I've never seen the fade distance be so large. How small are those models?

The shadow fading cannot be "reversed" because it's not working like you think. This fading is a side effect of the way the shader determines how shadowed a pixel is: it uses the depth difference between to the light. The smaller the difference, the fainter the shadow. This prevents the depth aliasing. You'll never get rid of it, but you can minimize it by toying with the overdarkfactor values until you find the maximum one that doesn't cause depth aliasing artifacts.
#2
06/15/2009 (11:55 am)
Hi Manoel, thanks for the reply,

Yes, I'm a complete novice when it comes to GFX programming,
Although i do know when I see something that doesn't seem right :)

Re: scale of model
Its a Dif, perhaps this shot will show the scale:

www.aev-uk.com/sites/hewster/forum_stuff/T3D/beta2/images/Beta2_sun-shadow_03.jpg
If I up the "overdarkfactor" to the values I posted above, we get a good
shadow:

www.aev-uk.com/sites/hewster/forum_stuff/T3D/beta2/images/Beta2_sun-shadow_04.jpg
But the side effect is odd shading on high incline areas.. see vid:


I should also point out this is Beta2 with Toms shadow fix:
www.garagegames.com/community/forums/viewthread/92629/1#comment-626835
#3
06/15/2009 (12:01 pm)
The overdarkfactor contains 4 values. Each one controls the overdark for each split of the PSSM. The first split covers the areas closest to the camera, while the last one covers whatever was left after the 3rd split until the maximum shadow distance.

Since the texel density gets progressively lower on the 2nd, 3rd and 4th splits, you need to use lower overdarkfactor for those. 5000 for the last split is far too much. Too high overdark factors will darken unshadowed areas as well.
#4
06/15/2009 (12:59 pm)
Manoel, again, thanks for the response.

I appreciate what you are saying, and have spent a lot of time trying
to find the ideal compromise here, however, I feel there is an issue
with the shading of faces that are in world space nearly opposite
to the sun, and yet a shadow is being generated.

I will continue to "play", and endeavour to produce a level that
will demonstrate my findings more concisely.

Maybe I'm being too "anal" about this, but feel there could definitely
be some kind of tweak to minimise the issues i am seeing.

I would also like to say, being a GarageGames owner for some years now,
am very thrilled how T3D is progressing.. It truly is fantastic :D

Hewster
#5
06/15/2009 (1:49 pm)
Manoel is correct here... its a side effect of the ESM calculation which is used to generate a good shadow edge without getting shadow acne.

That said we are looking at improving the quality of the Sun shadow in particular... so expect to see it getting better before the final release.
#6
06/15/2009 (5:49 pm)
Thanks Tom, I just looked through my previous posts and realised you had
already confirmed this "effect"
www.garagegames.com/community/forums/viewthread/92809/1#comment-626723
Sorry, I missed your reply there.

I look forward to beta3 and beyond, for your implementations of
"fixes" in this area.

Tom.. it seems to me you have been working your proverbial butt off
in T3D, and I for one appreciate all your hard work.

And in appreciation of that fact, I present you with:

www.aev-uk.com/sites/hewster/forum_stuff/T3D/beta2/images/beer_token3.jpg
redeemable at any bar or pub that you may find me in :D

Hewster
#7
08/02/2010 (4:27 pm)
Fixed in 1.1 Beta 2
#8
08/02/2010 (10:17 pm)
This is another one that, due to how closed tickets show up in the filter, was mistakenly commented on by the interns as fixed. Sorry about the confusion everyone.

For those interested in the resolution of this one. There was some research done into different techniques to fix the issue and we had two choices. One caused shadows to look far worse, and the other caused a 25% hit in perfomance. Thus the decision was made to leave it as it was.