Author Topic: Improving the 'PCSS' shader  (Read 2743 times)

A while ago I released a PCSS shader of sort; however, it's not from perfect:
-Depth search distance must be manually set (this is supposed to be automatic)
-No automatic adjustment of fudgeFactors with the light angle
-Blending between cascades not looking too good
So I need help polishing up this shader.

This is what I'm working on now, actually trying to implement it correctly: https://gist.github.com/QuadStorm/0ceed8e3a436e0bea4d640ca954702b8

Images:







Resources:
Blockland Attempts
Latest version of the 'old' shader: https://gist.github.com/QuadStorm/c87fdef316109aa265535d466791a296
Old PCSS shader release thread

PDFs
http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf
https://http.download.nvidia.com/developer/presentations/2005/SIGGRAPH/Percentage_Closer_Soft_Shadows.pdf
https://www.realtimeshadows.com/sites/default/files/sig2013-course-softshadows.pdf
http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf

Other Implementations
NVIDIA demo pcss: https://pastebin.com/n9XHi6n8 - originally from https://developer.nvidia.com/gameworksdownload "OpenGL Graphics and Compute Samples"
Some random paste with a opengl 120 implementation of PCSS: https://pastebin.com/Eg7PEDCx

can you do ascii shaders

can you do ascii shaders
pretty sure reshade has an ascii shader
i'm not really the guy to ask to make shaders as you can see from the OP


Made penumbra size vary width with shadow_coord.z or the cascade index (0 being closest cascade of the 4) and blending between cascades appears more tolerable.




The shader now actually does two comparisons, and may or may not be a tad bit faster. If anyone can figure out what the blocker search distance (searchDistance) is supposed to be optimally, I'll be forever grateful.
« Last Edit: August 13, 2018, 07:03:54 PM by QuadStorm »

Another PDF: https://http.download.nvidia.com/developer/presentations/2005/I3D/I3D_05_Percentage_Closer_Soft_Shadows.pdf
Like I said in the last post, the main issue I have now is having the blocker search distance (searchDistance) done right without having to add a variable that has to be adjusted. Blending between cascades looks alright for now, and the fudge factors, while a bit high are ok as well.

https://gist.github.com/QuadStorm/ddb7ecce4658ae48ab6b0dbc6b6ba430 is the latest version as of now, redoing the blocker search section and making it a separate function, however there's a pretty major graphics bug at a distance, which is why I made another gist instead of updating the other one.

EDIT: The distant issue is mostly gone, at the cost of far shadows being sharper than they should be.
« Last Edit: August 29, 2018, 08:28:43 PM by QuadStorm »