Skip to content
Snippets Groups Projects
Commit 18f09bac authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#82] Shadows adjustments?

parent 76d71b4b
No related branches found
No related tags found
1 merge request!70Resolve "Voxel cone tracing"
Pipeline #25991 failed
......@@ -87,7 +87,7 @@ void main() {
vec3 sun = lightInfo.sunStrength * lightInfo.sunColor * NoL;
float noise = 2 * pi * interleavedGradientNoise(gl_FragCoord.xy);
vec2 shadowOffset = vec2(sin(noise), cos(noise)) * 0.00008;
vec2 shadowOffset = 0.05f * vec2(sin(noise), cos(noise)) / textureSize(sampler2D(shadowMap, shadowMapSampler), 0);
float shadow = shadowTest(passPos, lightInfo, shadowMap, shadowMapSampler, shadowOffset);
sun *= shadow;
......
......@@ -86,7 +86,7 @@ float shadowTest(vec3 worldPos, LightInfo lightInfo, texture2D shadowMap, sample
shadowMapSample = unquantizeMoments(shadowMapSample);
float depthBias = 0.f;
float momentBias = 0.00005;
float momentBias = 0.000002;
float shadow = ComputeMSMShadowIntensity(shadowMapSample, lightPos.z, depthBias, momentBias);
return reduceLightBleeding(shadow, 0.1f);
......
......@@ -125,7 +125,7 @@ glm::mat4 computeShadowViewProjectionMatrix(
const vk::Format shadowMapFormat = vk::Format::eR32G32B32A32Sfloat;
const vk::Format shadowMapDepthFormat = vk::Format::eD32Sfloat;
const uint32_t shadowMapResolution = 1024;
const uint32_t shadowMapResolution = 2048;
const vkcv::Multisampling msaa = vkcv::Multisampling::MSAA8X;
ShadowMapping::ShadowMapping(vkcv::Core* corePtr, const vkcv::VertexLayout& vertexLayout) :
......@@ -156,7 +156,7 @@ ShadowMapping::ShadowMapping(vkcv::Core* corePtr, const vkcv::VertexLayout& vert
};
shadowPipeConfig.m_multisampling = msaa;
shadowPipeConfig.m_EnableDepthClamping = true;
shadowPipeConfig.m_culling = vkcv::CullMode::Front;
shadowPipeConfig.m_culling = vkcv::CullMode::Front;
m_shadowMapPipe = corePtr->createGraphicsPipeline(shadowPipeConfig);
m_shadowSampler = corePtr->createSampler(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment