Game Development Community

T3D Lighting?

by Thanhda Tie · in Torque 3D Professional · 05/25/2009 (12:27 am) · 7 replies

So, whats up with T3D light? why does it look so fuzzy?

#1
05/25/2009 (2:38 am)
That depends on what level setup you're using. The default sky/light object is set to a very fuzzy 100% shadow softening. I suggest 0.25. You'll also want to turn the split factor up, maybe lower the split fade distances, and increase the texture resolution to 1024 (seems to be hard-capped there). A distance of 400 is about right for a small terrain.

This was taken on a 512x512 resolution terrain. Higher resolution terrains appear to decrease the shadow resolution, but at this res it's still decent.

ubermonkey.phpwebhosting.com/terrainshadow2.jpg
Any actual fuzziness you see here is an edge-blending effect to make the shadows look less sharp. You can turn it all the way off (as I said, I have it at 0.25), but that doesn't look that great. The shadows have to be rendered as simple black&white maps, so it helps to smooth the edges a bit, unless you really hate the effect.
#2
05/25/2009 (6:30 am)
I think we need a few more shadow filtering options. The current one is incredibly taxing on low-bandwidth hardware (aka: anything below mid-range). A simple PCF with 2x2 and 3x3 kernel blur options would help. It would also please people who need sharp shadows, but don't want bare pixels.
#3
05/25/2009 (8:42 am)
The shadow's quality has to do with a few factors.

1. The shadow bitmap size that it is defined to use.
2. The light's cast radius/distance. The further an object gets away from the light source the less detailed the shadow bitmap becomes.
3. The type of shadow that is to be cast. Dual Parabloid maps are the least resource intensive but they arent quite as high quality as as a cubemap shadow.
4. Omni/Point lights will never has as sharp of a shadow as a spot or directional light. This is because 720 degrees of shadow information needs to be stored in the bitmap from a omni/point, but with a spot/directional light its a very limited segment along the raycast (and if you have a real small cast radius you get a sickly sharp looking set of shadows like from the fan blades and grates in Undercity).
5. There is a softness parameter. 1 is soft/fuzzy shadows like people want and expect, 0 are hard and unnatural looking shadows. You can set a value in between if you want something different.
#4
05/25/2009 (9:21 am)
Logan,, re: "The further an object gets away from the light source the less detailed the shadow bitmap becomes"

If I think in terms of real life... I would say, the further an object is from the
surface which its shadow is cast upon, the less defined the shadow outline is.

But from observations in the beta, it seems the inverse is true.

If you create a tall(very) model / interior... you should find that at the base
of your model (where it touches the ground) the shadow "darkness" is quite
lighter than the top of the shadow cast... it just seems inverted to me ?

Another example, using a player that has "jet" ability, stand in the sunlight,
and take off... watch as the shadow cast becomes darker and more refined..
again.. opposite of what I would expect (in the real world)
#5
05/25/2009 (9:44 am)
The sunlight shadows don't implement distance-based penumbra. PSSM might make it look like the shadow is getting softer in the distance, but it's all camera based: if you walk there and look closely the shadow softness is constant.
#6
05/25/2009 (11:15 am)
Playlore.. not sure if you were commenting on my post or not, but for me,
the shadow intensity (darkness) increases the further the object is from the
place the shadow hits.. the blurriness, as you say seems to be calculated
from the camera position (which makes sense).

Just wish I was more of a GFX programmer, then what I am seeing might make
more sense :/
#7
05/25/2009 (1:40 pm)
@Playlore
Quote:The current one is incredibly taxing on low-bandwidth hardware
That is the plan... we've been focusing on the higher quality first. We do plan to have simple PCF for the final release as well as SM 2.0 shaders with it.

@Hewster
Quote:If you create a tall(very) model / interior... you should find that at the base of your model (where it touches the ground) the shadow "darkness" is quite lighter than the top of the shadow cast... it just seems inverted to me ?
Your right... you are seeing this... and your right its not physically correct.

It is however how ESM and VSM shadow filtering work (we use ESMs) which remove shadow acne without a fixed 'bias' value.

If you increase the 'overDarkFactor' values in the Sun shadow it will darken the light leaking at the base of the shadow, but can also cause some acne artifacts.