Horde3D
http://horde3d.org/forums/

::strange shadows on terrain::
http://horde3d.org/forums/viewtopic.php?f=2&t=1689
Page 1 of 1

Author:  anchor [ 02.07.2012, 18:13 ]
Post subject:  ::strange shadows on terrain::

Hello!

Im moving from beta4 to beta5, and i found a strange shadow issue:

Image

Image

This happens, when the terrain shadow-casting is turned off.
In the beta4, i never experienced that. Can anyone tell me,
what changed in the shadow system, or how can i fix this?
Our terrain is big, 1280x1280 unit.

Update:
I modified the chicago sample, to show the shadow issue.
The project link:
http://anchor.netexpert.hu/temp/misc/Horde3D_SDK_1.0.0_Beta5_shadow.rar

anchor

Author:  attila [ 03.07.2012, 22:15 ]
Post subject:  Re: ::strange shadows on terrain::

I've tested the demo. It seems like the extra shadow is caused by the "over" optimized bounding boxes in shadow map rendering.
Because the bounding box contains only caster objects, receiver objects' shader (fragLighting.glsl) could use fragments outside of the current tile.

Removing the SceneNodeFlags::NoCastShadow in the "Find post-projective space AABB of all objects in frustum" and "Find AABB of lit geometry" section in egRendererBase.cpp
solved the problem but the shadows quality is much worse this way.
In the current implamentation of updateShadowMap AFAICS maxDist could be very large if large objects are used. I think it could be maximized to camera's farplane.

Instead of removing the flags a better solution could be to use sampler2DArrayShadow instead of sampler2DShadow in fragLighting.glsl to avoid using fragments outside of the current tile like in this: http://developer.download.nvidia.com/SD ... w_maps.pdf

Or use a slower map based selection:
http://msdn.microsoft.com/en-us/library ... 07(v=vs.85).aspx

An extremely simple solution (I've used in our game)
Instead of computing minDist/maxDist we used fixed values. This way shadow quality is more consistent. But this is not optimal and needs hand tune for different scenes.

Author:  anchor [ 12.07.2012, 01:22 ]
Post subject:  Re: ::strange shadows on terrain::

Thanks Attila, i solved the problem ;)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/