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

[#82] Add mipmapping to moment shadow mapping - still not convinced

parent 8ca8074b
No related branches found
No related tags found
1 merge request!70Resolve "Voxel cone tracing"
This commit is part of merge request !70. Comments created here will be created in the context of that merge request.
......@@ -21,7 +21,7 @@ void main(){
if(any(greaterThanEqual(gl_GlobalInvocationID.xy, imageSize(outImage)))){
return;
}
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
float z = 0;
for(int i = 0; i < msaaCount; i++){
......
......@@ -16,7 +16,7 @@ void main(){
}
ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
int blurRadius = 0;
int blurRadius = 5;
int minOffset = -(blurRadius-1) / 2;
int maxOffset = -minOffset;
......
......@@ -130,7 +130,7 @@ const vkcv::Multisampling msaa = vkcv::Multisampling::MSAA4
ShadowMapping::ShadowMapping(vkcv::Core* corePtr, const vkcv::VertexLayout& vertexLayout) :
m_corePtr(corePtr),
m_shadowMap(corePtr->createImage(shadowMapFormat, shadowMapResolution, shadowMapResolution, 1, false, true)),
m_shadowMap(corePtr->createImage(shadowMapFormat, shadowMapResolution, shadowMapResolution, 1, true, true)),
m_shadowMapIntermediate(corePtr->createImage(shadowMapFormat, shadowMapResolution, shadowMapResolution, 1, false, true)),
m_shadowMapDepth(corePtr->createImage(shadowMapDepthFormat, shadowMapResolution, shadowMapResolution, 1, false, false, false, msaa)),
m_lightInfoBuffer(corePtr->createBuffer<LightInfo>(vkcv::BufferType::UNIFORM, sizeof(glm::vec3))){
......@@ -161,7 +161,7 @@ ShadowMapping::ShadowMapping(vkcv::Core* corePtr, const vkcv::VertexLayout& vert
m_shadowSampler = corePtr->createSampler(
vkcv::SamplerFilterType::LINEAR,
vkcv::SamplerFilterType::LINEAR,
vkcv::SamplerMipmapMode::NEAREST,
vkcv::SamplerMipmapMode::LINEAR,
vkcv::SamplerAddressMode::CLAMP_TO_EDGE
);
......@@ -261,6 +261,7 @@ void ShadowMapping::recordShadowMapRendering(
dispatchCount,
{ vkcv::DescriptorSetUsage(0, m_corePtr->getDescriptorSet(m_shadowBlurDescriptorSet).vulkanHandle) },
vkcv::PushConstantData(nullptr, 0));
m_shadowMap.recordMipChainGeneration(cmdStream);
m_corePtr->prepareImageForSampling(cmdStream, m_shadowMap.getHandle());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment