Graphics: Fix point light shadowmaps
This commit is contained in:
@@ -217,7 +217,6 @@ fn main(input: VertToFrag) -> FragOut
|
|||||||
|
|
||||||
const sampleCount = 4;
|
const sampleCount = 4;
|
||||||
const offset = 0.005;
|
const offset = 0.005;
|
||||||
const bias = 0.05;
|
|
||||||
|
|
||||||
const invSampleCount = 1.0 / f32(sampleCount);
|
const invSampleCount = 1.0 / f32(sampleCount);
|
||||||
const start = vec3[f32](offset * 0.5, offset * 0.5, offset * 0.5);
|
const start = vec3[f32](offset * 0.5, offset * 0.5, offset * 0.5);
|
||||||
@@ -237,8 +236,8 @@ fn main(input: VertToFrag) -> FragOut
|
|||||||
|
|
||||||
let depth = shadowMapsCube[i].Sample(sampleDir).r;
|
let depth = shadowMapsCube[i].Sample(sampleDir).r;
|
||||||
depth = LinearizeDepth(depth, 0.01, lightRadius);
|
depth = LinearizeDepth(depth, 0.01, lightRadius);
|
||||||
|
|
||||||
if (depth > dist - bias)
|
if (depth > dist)
|
||||||
shadowFactor += shadowContribution;
|
shadowFactor += shadowContribution;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ namespace Nz
|
|||||||
|
|
||||||
auto& textureEntry = m_textureBindingCache.emplace_back();
|
auto& textureEntry = m_textureBindingCache.emplace_back();
|
||||||
textureEntry.texture = texture;
|
textureEntry.texture = texture;
|
||||||
textureEntry.sampler = shadowSampler.get();
|
textureEntry.sampler = defaultSampler.get(); //< cube shadowmap don't use depth compare
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& bindingEntry = m_bindingCache.emplace_back();
|
auto& bindingEntry = m_bindingCache.emplace_back();
|
||||||
|
|||||||
Reference in New Issue
Block a user