Horde3D

Next-Generation Graphics Engine
It is currently 09.11.2024, 01:45

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 27.02.2012, 12:25 
Offline

Joined: 16.05.2009, 12:43
Posts: 207
Ok, wanted to fix some issues with my scene, you can check out work in progress here: http://youtu.be/lvJF7QTq-sY?hd=1

Basically, if you look at the ground when I'm moving stuff around, you'll see that shadows in general have a problem when close to the object I'm standing on when I took the vid.

The light that is being used here is about 500 units up from the platform, with a range of around 1700 units (1 unit = 1 meter).

So I'm really trying to figure out how to get the best results for a skylight, which presumably wasn't the intention of the spotlight used in Horde. So I could use some feedback on what would be useful to change code wise.

If you read the paper on CSM from the nvidia site here: http://developer.download.nvidia.com/SD ... w_maps.pdf

So what I'm wondering is that the CSM implementation in horde, as far as I can make out, uses 1 texture to render the shadow map. It also seems to use a perspective projection from the shadowing light, rather than the ortho projection I'd expect. Finally, I seem to be getting depth resolution issues (shadows don't seem to project onto near objects, only when the distance between them increases).

So, really just wondering what actually to change here to fix up a decent directional "skylight" light and shadow projection for a typical daylight scene. Any advice would be welcome!


Top
 Profile  
Reply with quote  
PostPosted: 27.02.2012, 23:47 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
zoombapup wrote:
So what I'm wondering is that the CSM implementation in horde, as far as I can make out, uses 1 texture to render the shadow map. It also seems to use a perspective projection from the shadowing light, rather than the ortho projection I'd expect.

The CSM implementation uses one shadow map but splits it into an atlas with four quadrants that will be used for the cascades. Regarding the parallel shadow projection, this thread might help you: http://horde3d.org/forums/viewtopic.php?f=2&t=368

The precision issues you describe could be related to the shadow map bias which is tweakable per light source. Also make sure that the shadow casting scene is as tight as possible and that there is no skybox or other large objects outside your main scene that have shadows enabled, otherwise you can lose a lot of resolution as the implementation will try to fit the merged shadow caster AABBs into the shadow map.


Top
 Profile  
Reply with quote  
PostPosted: 28.02.2012, 13:52 
Offline

Joined: 16.05.2009, 12:43
Posts: 207
Hmm, ok, I'll have a look at the bias function and see how that effects the scene. Ideally the shadow maps should be bounded by the box created from the splits though shouldn't they. So it really shouldn't be affected by geometry at all (more the frustrums created by the splits). Although one thing that occurred to me when reading the nvidia CSM paper was that casters might be behind the camera and actually hit the frustum splits, so need some way of determining a reasonable distance for the skylight. I guess it might be ok to just assume a given distance (some param on the renderer) and project an ortho projection from the center of each frustum from the skylight direction onto the frustum.

So really, this should (theoretically) just be a pretty simple tweak of updateShadowMap to encompass the split frusta? into an ortho projection.. hmm, will try it later this week I think.

Thanks for the info on the shadow bias, will have a look at that now.


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 5 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