Implemented Shadow maps (still needs improvement) #314
|
@ -60,7 +60,7 @@ float CalcShadowValue (sampler2D shadowMap, vec4 worldSpaceFragPos, mat4 lightPV
|
||||||
|
|
||||||
if (fragPosLightPOV.z > sampledDepth && fragPosLightPOV.w > 0.0f)
|
if (fragPosLightPOV.z > sampledDepth && fragPosLightPOV.w > 0.0f)
|
||||||
{
|
{
|
||||||
return 0.3f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
Binary file not shown.
|
@ -33,6 +33,7 @@ namespace SHADE
|
||||||
.maxAnisotropy = 1.0f,
|
.maxAnisotropy = 1.0f,
|
||||||
.minLod = params.minLod,
|
.minLod = params.minLod,
|
||||||
.maxLod = params.maxLod,
|
.maxLod = params.maxLod,
|
||||||
|
.borderColor = vk::BorderColor::eFloatOpaqueWhite
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the sampler
|
// Create the sampler
|
||||||
|
|
|
@ -412,7 +412,7 @@ namespace SHADE
|
||||||
lightingSubSystem = resourceManager.Create<SHLightingSubSystem>();
|
lightingSubSystem = resourceManager.Create<SHLightingSubSystem>();
|
||||||
lightingSubSystem->Init(device, descPool, &resourceManager, samplerCache.GetSampler (device, SHVkSamplerParams
|
lightingSubSystem->Init(device, descPool, &resourceManager, samplerCache.GetSampler (device, SHVkSamplerParams
|
||||||
{
|
{
|
||||||
// nothing for now
|
.addressMode = vk::SamplerAddressMode::eClampToBorder,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -518,7 +518,7 @@ namespace SHADE
|
||||||
if (auto renderer = light.GetRenderer())
|
if (auto renderer = light.GetRenderer())
|
||||||
{
|
{
|
||||||
//SHMatrix orthoMatrix = SHMatrix::OrthographicRH()
|
//SHMatrix orthoMatrix = SHMatrix::OrthographicRH()
|
||||||
renderer->UpdateDataManual(frameIndex, GetViewMatrix(&light), SHMatrix::OrthographicLH(30.0f, 30.0f, 1.0f, 50.0f));
|
renderer->UpdateDataManual(frameIndex, GetViewMatrix(&light), SHMatrix::OrthographicLH(10.0f, 10.0f, 1.0f, 50.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto enumValue = SHUtilities::ConvertEnum(light.GetLightData().type);
|
auto enumValue = SHUtilities::ConvertEnum(light.GetLightData().type);
|
||||||
|
|
Loading…
Reference in New Issue