About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
How to set shadow range?
Author Message
Gian-Reto Offline
Member

Post: #1
How to set shadow range?
I'm playing around with the shadows for a while, but one thing I don't see how I could achieve:

I want to have an "isometric" view for my game. Now, that means that view distance is quite fixed, and I rather not have cascaded shadow maps, just one map (I guess I'll save some frames by doing that)

I would rather adjust the "shadow drawing distance" every time I zoom in or out, so I would get the best possible performance/visual compromise.

What I don't get with Esenthels Shadow Map system.... how do I set the range of shadows? It seems fixed, as I only can set D.shdFrac so that only a fraction of the viewport is shadowed..... how is that viewport size computed? I don't think this works for isometric views?

The reason why I don't think it works, every time I set D.shdMapNum to 1, I get only very low-res shadows, so it seems the shadow system defaults to the lowest res shadow-map, that covers the biggest area. I would like to manually resize that area so I would get better quality shadows.

I'm using the deferred renderer...


Thanks for the help

Gian-Reto
04-08-2011 01:22 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #2
RE: How to set shadow range?
in shadow draw function you could also do
Code:
if(Dist(cam.at,object.pos)<flt range)
//if(frustum)
{
//Draw stuff
}
(This post was last modified: 04-08-2011 03:59 PM by Zervox.)
04-08-2011 03:59 PM
Find all posts by this user Quote this message in a reply
llynx Offline
Member

Post: #3
RE: How to set shadow range?
Oh that gives me an idea, using fast shadows for object far away then switching to real shadows when in the appropriate range.
04-08-2011 04:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: How to set shadow range?
Use D.shdFrac, read comments on that function
for example D.shdFrac(0.5f)
04-09-2011 01:48 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #5
RE: How to set shadow range?
D.shdFrac helps.... now the shadow quality is much higher.... yet I still don't understand how the viewport size is measured...

the idea with the fast shadows could be an idea, yet for a night-day-cycle, these fast shadows need some update cycle, so they don't point in the complete wrong direction... they don't need to be updated every frame though, might save some computation time...

The shadow_step Function pointer, how can I understand the comment? Can I tell the Engine with this function how to decide to change from one shadowMap step to the next?
04-10-2011 09:50 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: How to set shadow range?
yes, its usage is in ERPG2 sources.
04-10-2011 10:09 AM
Find all posts by this user Quote this message in a reply
Post Reply