Archived
1
Fork 0

Fix sampling modes on shadow maps

This commit is contained in:
redstrate 2021-05-12 10:52:57 -04:00
parent 98ca5684b9
commit 181d2fda06

View file

@ -43,6 +43,8 @@ void ShadowPass::create_scene_resources(Scene& scene) {
textureInfo.height = render_options.shadow_resolution;
textureInfo.format = GFXPixelFormat::DEPTH_32F;
textureInfo.usage = GFXTextureUsage::Sampled | GFXTextureUsage::Attachment;
textureInfo.samplingMode = SamplingMode::ClampToBorder;
textureInfo.border_color = GFXBorderColor::OpaqueWhite;
scene.depthTexture = gfx->create_texture(textureInfo);
@ -62,8 +64,9 @@ void ShadowPass::create_scene_resources(Scene& scene) {
cubeTextureInfo.height = render_options.shadow_resolution;
cubeTextureInfo.format = GFXPixelFormat::R_32F;
cubeTextureInfo.usage = GFXTextureUsage::Sampled;
cubeTextureInfo.samplingMode = SamplingMode::ClampToEdge;
cubeTextureInfo.array_length = max_point_shadows;
cubeTextureInfo.samplingMode = SamplingMode::ClampToBorder;
cubeTextureInfo.border_color = GFXBorderColor::OpaqueWhite;
scene.pointLightArray = gfx->create_texture(cubeTextureInfo);
}
@ -77,8 +80,9 @@ void ShadowPass::create_scene_resources(Scene& scene) {
spotTextureInfo.height = render_options.shadow_resolution;
spotTextureInfo.format = GFXPixelFormat::DEPTH_32F;
spotTextureInfo.usage = GFXTextureUsage::Sampled | GFXTextureUsage::Attachment;
spotTextureInfo.samplingMode = SamplingMode::ClampToEdge;
spotTextureInfo.array_length = max_spot_shadows;
spotTextureInfo.samplingMode = SamplingMode::ClampToBorder;
spotTextureInfo.border_color = GFXBorderColor::OpaqueWhite;
scene.spotLightArray = gfx->create_texture(spotTextureInfo);
}