Blockland Forums > Modification Help
Percentage-Closer Soft Shadows (PCSS) - Dynamic Soft Shadows based on distance
QuadStorm:
https://pastebin.com/XJNYumvQ
* based on port's poisson disc shadow shader, and includes minor modifications by me, and distance is not distance from the camera anymore...
See http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf
There are issues with blending between shadow cascades, but I'm satisfied with the results. This isn't really ready to use all the time since I messed up some stuff but it'll be fine for a demo. Certain settings make the shadows simply get lighter with distance as well, rather than softer, especially with distant objects. The shadow map resolution matters too with what the effect ends up looking like (lighter shadows vs correct softening), something which I tried (and apparently failed) to mitigate.
Preview:
portify:
This is what I've been trying to release for a while, I just kept getting the same shadow cascade blending issue as you have here so I was never satisfied with it. How's the perf?
QuadStorm:
--- Quote from: portify on January 21, 2018, 06:13:47 PM ---This is what I've been trying to release for a while, I just kept getting the same shadow cascade blending issue as you have here so I was never satisfied with it. How's the perf?
--- End quote ---
I get around 30 FPS with the fixed softness shader, and 25-28 FPS with dynamic softness with the device I'm using and looking at MotE Mansion's shadow.
Conan:
one step closer to real life in bl
Pah1023:
--- Quote ---void applyLighting(inout vec4 combinedColor, vec4 albedo, float occlusionFactor)
{
//large normal means glowing object
if(glow == 1 || (worldNormal.x + worldNormal.y + worldNormal.z) > 2.0f)
{
combinedColor = albedo;
return;
}
--- End quote ---
Change combinedColor = albedo; to combinedColor = albedo*1.5; to have off-like glowing effects.
From left to right is off, max w/o albedo change, max w/ 1.5x.