Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/LightMapRendering.cpp
Allan Bentham 53b8d22820 CSM fixes for forward renderer
MAX_FORWARD_SHADOWCASCADES is correctly defined for OutEnvironment.
 Only render shadow maps that have been successfully allocated texture space.
 fwd shader can deal with full range of MAX_FORWARD_SHADOWCASCADES.
 limit shadow map renders to no more than MAX_FORWARD_SHADOWCASCADES.
 reduce shadow map size to ensure all tiles fit within GMaxShadowDepthBufferSize.
Fixes UE-10282.
#codereview nick.penwarden, Rolando.Caloca

[CL 2466184 by Allan Bentham in Main branch]
2015-03-02 08:00:04 -05:00

17 lines
869 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
LightMapRendering.cpp: Light map rendering implementations.
=============================================================================*/
#include "RendererPrivate.h"
#include "SceneManagement.h"
void FMovableDirectionalLightCSMLightingPolicy::ModifyCompilationEnvironment(EShaderPlatform Platform, const FMaterial* Material, FShaderCompilerEnvironment& OutEnvironment)
{
OutEnvironment.SetDefine(TEXT("MOVABLE_DIRECTIONAL_LIGHT"), TEXT("1"));
OutEnvironment.SetDefine(TEXT("MOVABLE_DIRECTIONAL_LIGHT_CSM"), TEXT("1"));
OutEnvironment.SetDefine(TEXT(PREPROCESSOR_TO_STRING(MAX_FORWARD_SHADOWCASCADES)), MAX_FORWARD_SHADOWCASCADES);
FNoLightMapPolicy::ModifyCompilationEnvironment(Platform, Material, OutEnvironment);
}