PCSS shadows

From this pdf I was attempting to add PCSS shadows to the sm4 deffered rendering help patch

I get an error however in the shader telling me that
SampleCmpLevelZero doesn’t take 3 parameters, and the tells me possible methods of use, which all take 3 parameters…

Any ideas whats wrong?

PCSS errors (14.5 kB)

float fShadow = g_ShadowMap.SampleCmpLevelZero( ShadowSampler, vModProjUV.xy, vModProjUV.z);

http://msdn.microsoft.com/en-us/library/windows/desktop/bb509644(v=vs.85).aspx

can’t help mutch busy like hell tho…

That’s the thing, I’m giving it the right number of inputs, and they’re the right dimensions, I’ve swizzled them to check… And it still says its an error!
I’ve tried putting constants in, and changing the sampler, still no go…

it was a type problem, you wanted to input a normal sampler, but you need some special type of it:

via http://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx

it should compile now… but you need to gather all the input data now via dx11 semantics or outputs from the renderers… good luck!

shadow_basic2.zip (16.2 kB)

Thanks Tonfilm, I’ll check that out but I’m away for a few days, let you know how I get on!

Here’s where I’ve got to, implimenting the PCF has prooved trickier than I thought, so heres a start with just PCF.
I’m not sure the PCF is filtering or not, seems blocky still, any one any ideas about it?
The deffered version renders differently to the version projecting onto the mesh, which is also odd, or more likely ignorance on my part :D
I also tried putting Microdee’s world from depth map tfx inside the shader, and it brakes, havent looked that much further into it!
Its a start though, anyone care to chip in with an other ideas to improve it?

A start at deffered soft shadows, not quite finished… (21.4 kB)

deffered-pcf-shadows

Seems sleeping on it helped some!
Heres a PCF shadow, next challenge PCSS!

Well you can see something, but unfortunatly its not right!
Any pointers?

PCSS wip none working (27.8 kB)

the shadows in mre.mdmod.2 do a very similar thing. of course my stuff doesn’t have as good filtering as the nvidia method has and it’s slower as well. however i decided to create the sample offsets (representing points on the light’s surface relative to the light’s position) in a dynamic buffer. currently those points are arranged in a spherical range which is good for point lights but not that practical for spotlights (in next version i will change that to a plane which is rotated in the direction of the spotlight)

@microdee, I was looking for a quick to drop into any patch solution, as well as a faster one, even on my desktop, MRE is a bit slow! I’d see it as an alternative rather than a replacement, I love the volumetrics and material server in yours!
I’m getting weird ghosting still with this defered one, the reprojection onto a mesh above is slightly cleaner, I’m not sure why!