Sharp or soft shadows

G3ck0G33k

Newcomer
A question regarding soft/hard shadows.

Has anyone implemented hard shadows as a function over distance? Where the shadow effect decreases over distance from the light source(s). Surely this would produce soft(er) shadows, o am I wrong (again)?
 
G3ck0G33k said:
A question regarding soft/hard shadows.

Has anyone implemented hard shadows as a function over distance? Where the shadow effect decreases over distance from the light source(s). Surely this would produce soft(er) shadows, o am I wrong (again)?

Yes.
It can look better than simple hardshadows, but it depends on the application.
 
To my understanding the hard part about soft shadows is getting the shadow intensity to decrease gradually at the edges (as they do for a non-point light source) rather than all at once.
 
Well, I'm just a beginner when it comes to shadow rendering, but the only way I've seen soft shadows implemented for shadow volumes is by jittering the position of the light and using multiple shadow passes. It's quite costly, but achieves the effect of the "softness" of the shadow being greater at further distances from the object.
 
Two ways of doing soft shadows. The first one jitters the light position and accumulates. The second one uses a bunch of tricks to achieve a similar effect with fewer passes, and most importantly, only needs the shadow drawn once.

These RenderMonkey workspaces will be included in the next beta.

softshadows.jpg
 
Small question Humus... Why is the background showing through around the lid of the pot and in the tip? :)

Sorry, I don't mean to nitpick, just curious here... :)

*G*
 
Grall said:
Small question Humus... Why is the background showing through around the lid of the pot and in the tip? :)

Sorry, I don't mean to nitpick, just curious here... :)

*G*

Well, that's the Teapot for you. :)
It's the object that is flawed. How old is this thing anywoy?
 
The Utah Teapot was created in 1975 (that's older than I ;) ). However, the original teapot does not have the bottom.
 
Grall said:
Small question Humus... Why is the background showing through around the lid of the pot and in the tip? :)

Sorry, I don't mean to nitpick, just curious here... :)

*G*

Cause backface culling removed the faces you shouldn't see through...
Either they should disable it or double the poly count to have front facing polys too.
 
That's a usual problem with the Utah teapot. It's not a completely enclosed object, so there are places where you can see the back faces.
 
Humus,

Why is there no self shadowing? Is this just some sort of trick, like in one the ATI soft shadow demo for the original Radeon?
 
Cool :) Are you using shadow maps and distance to occlude to expand the filter kernal like I do in the Cg demo ?

The main problem is holding the 'nearest occluder depth' rather than the 'closes to light' depth. But of course there are solutions to that :)
 
Mintmaster said:
Humus,

Why is there no self shadowing? Is this just some sort of trick, like in one the ATI soft shadow demo for the original Radeon?

Its because I used projective shadows. I could use shadow mapping instead, which I planned on at first, but since RenderMonkey currently does not support rendering to cubemaps (I prefer omni-directional lights)
and you can't do CPU work in RenderMonkey but would rather have to contruct the lights view-projection matrix (in case of spotlight) in the vertex shader instead I decided that projective shadowing would be good enough. I did however create a shadow mapping workspace for spotlights at a later time despite the trouble, but I didn't feel like changing these two workspaces to use shadowmapping too.
 
pocketmoon_ said:
Cool :) Are you using shadow maps and distance to occlude to expand the filter kernal like I do in the Cg demo ?

The main problem is holding the 'nearest occluder depth' rather than the 'closes to light' depth. But of course there are solutions to that :)

Well, in the second algoritm I basically render the shadow to a texture and render some kind of blur factor into another texture. The blur factor is simply distance(object, shadow) / distance(light, shadow). I then use the blur factor as the size of the blur filter. To avoid getting a sharp edge in the middle of the shadow edge I apply a simple dilate filter on the blur factor texture before that.
 
Back
Top