mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Adjust shadowmap distortion to use entire SM texture (#12166)
This commit is contained in:
@@ -158,7 +158,6 @@ void ShadowRenderer::setShadowIntensity(float shadow_intensity)
|
||||
disable();
|
||||
}
|
||||
|
||||
|
||||
void ShadowRenderer::addNodeToShadowList(
|
||||
scene::ISceneNode *node, E_SHADOW_MODE shadowMode)
|
||||
{
|
||||
@@ -261,8 +260,9 @@ void ShadowRenderer::updateSMTextures()
|
||||
cb->MaxFar = (f32)m_shadow_map_max_distance * BS;
|
||||
cb->PerspectiveBiasXY = getPerspectiveBiasXY();
|
||||
cb->PerspectiveBiasZ = getPerspectiveBiasZ();
|
||||
cb->CameraPos = light.getFuturePlayerPos();
|
||||
}
|
||||
|
||||
|
||||
// set the Render Target
|
||||
// right now we can only render in usual RTT, not
|
||||
// Depth texture is available in irrlicth maybe we
|
||||
@@ -322,9 +322,10 @@ void ShadowRenderer::update(video::ITexture *outputTarget)
|
||||
if (!m_shadow_node_array.empty() && !m_light_list.empty()) {
|
||||
|
||||
for (DirectionalLight &light : m_light_list) {
|
||||
// Static shader values.
|
||||
m_shadow_depth_cb->MapRes = (f32)m_shadow_map_texture_size;
|
||||
m_shadow_depth_cb->MaxFar = (f32)m_shadow_map_max_distance * BS;
|
||||
// Static shader values for entities are set in updateSMTextures
|
||||
// SM texture for entities is not updated incrementally and
|
||||
// must by updated using current player position.
|
||||
m_shadow_depth_entity_cb->CameraPos = light.getPlayerPos();
|
||||
|
||||
// render shadows for the n0n-map objects.
|
||||
m_driver->setRenderTarget(shadowMapTextureDynamicObjects, true,
|
||||
|
Reference in New Issue
Block a user