Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 05:54

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 02.07.2012, 18:13 
Offline

Joined: 29.10.2010, 14:28
Posts: 46
Location: Hungary
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


Top
 Profile  
Reply with quote  
PostPosted: 03.07.2012, 22:15 
Offline

Joined: 26.08.2008, 18:48
Posts: 120
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.


Top
 Profile  
Reply with quote  
PostPosted: 12.07.2012, 01:22 
Offline

Joined: 29.10.2010, 14:28
Posts: 46
Location: Hungary
Thanks Attila, i solved the problem ;)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group