WickedEngine
WickedEngine copied to clipboard
Shadowmap artifacts
Is it possible to fix (or to make less noticeable) these shadowmap artifacts (aliasing, shadow acne) ? May be I can change some settings to resolve it ?
Scene for example: 1111.zip
Hello, I have changed a litle the split for cascaded shadows in wiRenderer.cpp at line 2287 like this : const float splits[CASCADE_COUNT + 1] = { referenceSplitClamp * 0.0f, // near plane referenceSplitClamp * 0.01f, // near-mid split referenceSplitClamp * 0.05f, // mid-far split referenceSplitClamp * 1.0f, // far plane };
And changed a litle the scaling factor of your scene (litle bigger) to have this result.
Maybe there is some better way, I don't know.
Thanks, it's a little better !
You can increase shadow resolution, try the suggestions above by Cop46, or modify depth bias for shadow rendering pipelines (they are hard coded in wiRenderer.cpp, but I don't recommend modifying those)
The shadow rendering pipelines are using rasterizers[RSTYPE_SHADOW] and rasterizers[RSTYPE_SHADOW_DOUBLESIDED], those are created around here currently: https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiRenderer.cpp#L1865 The depth bias parameters are:
rs.depth_bias = -1;
rs.depth_bias_clamp = 0;
rs.slope_scaled_depth_bias = -4.0f;