Sign in to follow this  
zoret

point light soft shadows

Recommended Posts

hi guys, i'm now coming back on my point light shadows implementation (just using a float cube render target where i write the distance to the light in range 0,1) is there a hack to blur the shadows ? since i use the projected position (3d) of the vertex in light space, i can't really do a simple 2d neighbour to blur my shadows i planned to use a 3D volume texture to jitter it, do you think this is the good way to follow ? maybe there's a better solution (rendering n 6 depth render target instead of 1 cube render target to use hardware pcf but i definitely don't kwow how i can look up in my depth target in the final pass (when i ask for each pixel if it's lighted or shadowed) thanks a lot for any help !

Share this post


Link to post
Share on other sites
you can use VSDCT for this. You find more information about this in ShaderX3 (with an article based on ShaderX2). It basically unfolds a cubemap into a 2D texture and uses simple cubemaps to transform the 3D texcoord into a 2D texcoord in your shader. For the 2D texture you can then use hardware shadow maps,

Or storing VSM values in your Cube texture should also give you filtering if you hardware supports it.

Regards,
Kenzo

Share this post


Link to post
Share on other sites
Quote:
Original post by Guoshima
you can use VSDCT for this. You find more information about this in ShaderX3 (with an article based on ShaderX2).


VSDCT ?? what doest that mean ?
I have Shaderx2 but not the 3 ! what is the article you're talking about ?
what did it add in shaderx 3 ?

thanks

Share this post


Link to post
Share on other sites
The correct blurring would be based on the solid angle - ATI has a paper on what they call "angular extent filtering", but I'm not sure if this is particularly doable in real time yet. Perhaps only for small cube maps.

You could optionally use a representation like dual paraboloid maps wherein a box filter is close to optimal. That said, DP maps come with their own sets of problems.

Share this post


Link to post
Share on other sites
Quote:
Original post by zoret
VSDCT ?? what doest that mean ?

VSDCT = Virtual Shadow Depth Cubemap Texture
Basically it's a 2D atlas texture big enough to hold all cubemap faces. When rendering the faces of the cubemap you set the viewport to the correct region on the VSDC texture. When using the VSDC texture you use an indirection cubemap, which convert the 3D texcoord to the correct 2D texcoord on the VSDCT. Of course there are some problems with discontinuities (it has to do with the way you arrange the cm faces on the 2D atlas) and you may have problem with blurring (you need to pad the individual sides with some pixels as well as alter the camera's projection matrix when rendering the VSDCT).

Quote:

I have Shaderx2 but not the 3 ! what is the article you're talking about ?
what did it add in shaderx 3 ?

The only reference to ShaderX2 from this article is an article named "Floating Point Cube Maps" by Arkadiusz Waliszewski, but i don't know what the article say because i don't have ShaderX2 :) The article in ShaderX3 is "Efficient Omnidirectional Shadow Maps" by Gary King and William Newhall.

If you need some more info on VSDCT, i think a presentation from nVidia (talking about the Mad Mod Mike demo) talks about the technique in some detail (as well as problems that may arise). I'll try to dig it, but you can search for it in the nVidia developer's site.

Hope that helps.

HellRaiZer

EDIT : Here is the presentation from nVidia :
GPU Programming Exposed: The Naked Truth Behind NVIDIA's Demos
Near the end they talk about shadows from omni lights in the Mad Mod Mike demo and how they used the VSDCT technique.

[Edited by - HellRaiZer on October 22, 2006 2:01:10 AM]

Share this post


Link to post
Share on other sites
I had to sleep between my precedent post and this one.. and maybe I will have found something like a flash of inspiration during my last dream :)
because I've found a "solution" to this problem..
and finally I have to admit that there was still a problem

ok render to a big 2D atlas render target instead to a cube map seems pretty easy
but use this atlas shadow map to know if the pixel is in shadow or not was where I stumped...
my idea should not be very efficient :
for each position in light space, compute the dot with each of the 6 unit vector (+x,-x,+y,-y,+z,-z) to compute the atlas offset you have to use
not very nice !!!

so HellRaiZer gave me EXACTLY what I was thinking about !
I should have think about using a indirection/conversion cubemap, that's seriously an excellent idea ! Thanks (maybe I should have wait one night more ! :)
in any case, how create this cubemap ?

Another problem but this time it seems there's no solution, how can we solve the discontinuities problem between 2 faces ?

Quote:
Original post by HellRaiZer
Of course there are some problems with discontinuities (it has to do with the way you arrange the cm faces on the 2D atlas) and you may have problem with blurring (you need to pad the individual sides with some pixels as well as alter the camera's projection matrix when rendering the VSDCT).


did you mean to enlarge the field of view used to render each cube face and use 100 degree for example instead exactly 90 ?
so we can do a global blur which will be correct between 2 different faces ?

I'm going to have a look on this NVidia demo ! thank you very much for your url

[Edited by - zoret on October 22, 2006 4:40:13 AM]

Share this post


Link to post
Share on other sites
ok I've just read the nvidia paper and it seems I have all the solutions needed !

have someone already tried to add variance to omni directionnal shadows using this technique ?
do you think this the case of flexion engine ?
http://www.quakewars.jp/slang/ovsm.htm

Share this post


Link to post
Share on other sites
Also you can use - smoothies (or see earlier CryTek patent - US 6,903,741).
It produce good-looking and fast soft shadows. Which are easy to adapting for a point light source.
But this method is fake (penumbra only outside), also in complex cases gives some other artefacts.

Share this post


Link to post
Share on other sites
Quote:
Original post by _sav_
Also you can use - smoothies (or see earlier CryTek patent - US 6,903,741).
It produce good-looking and fast soft shadows. Which are easy to adapting for a point light source.
But this method is fake (penumbra only outside), also in complex cases gives some other artefacts.


this is the method used by Crytek in their next game Crisis ?
what does the patent concretely cause ?
the method is fake ? for example a donut (on any object with a hole) will have false soft shadows (the hole won't be soft, is that you're talking about ?)

Share this post


Link to post
Share on other sites
Quote:
Original post by zoret
this is the method used by Crytek in their next game Crisis ?
what does the patent concretely cause ?

I'm not competent here.
Quote:

the method is fake ? for example a donut (on any object with a hole) will have false soft shadows (the hole won't be soft, is that you're talking about ?)

In original method - hole is problem, but you can try to generate smoothies on pixel level, as postprocessing. In this case there will be no problems with holey(alpha-test) objects.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this