using System.Diagnostics ;
using UnityEngine.Experimental.GlobalIllumination ;
using UnityEngine.Rendering ;
using UnityEngine.Rendering.PostProcessing ;
using UnityEngine.XR ;
namespace UnityEngine.Experimental.Rendering.LightweightPipeline
{
{
int vertexLightsCount = lightData . totalAdditionalLightsCount - lightData . pixelAdditionalLightsCount ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . AdditionalLightsText , lightData . totalAdditionalLightsCount > 0 ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . MixedLightingSubtractiveText , m_MixedLightingSetup = = MixedLightingSetup . Subtractive ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . VertexLightsText , vertexLightsCount > 0 ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . AdditionalLights , lightData . totalAdditionalLightsCount > 0 ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . MixedLightingSubtractive , m_MixedLightingSetup = = MixedLightingSetup . Subtractive ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . VertexLights , vertexLightsCount > 0 ) ;
// CoreUtils.SetKeyword(cmd, LightweightKeywords.MainLightCookieText, mainLightIndex != -1 && LightweightUtils.IsSupportedCookieType(visibleLights[mainLightIndex].lightType) && visibleLights[mainLightIndex].light.cookie != null);
// CoreUtils.SetKeyword(cmd, LightweightKeywordString s.MainLightCookieText, mainLightIndex != -1 && LightweightUtils.IsSupportedCookieType(visibleLights[mainLightIndex].lightType) && visibleLights[mainLightIndex].light.cookie != null);
LightShadows directionalShadowQuality = shadowData . renderedDirectionalShadowQuality ;
LightShadows localShadowQuality = shadowData . renderedLocalShadowQuality ;
shadowData . supportsSoftShadows ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . DirectionalShadowsText , directionalShadowQuality ! = LightShadows . None ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . LocalShadowsText , localShadowQuality ! = LightShadows . None ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywords . SoftShadowsText , hasSoftShadows ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . DirectionalShadows , directionalShadowQuality ! = LightShadows . None ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . LocalShadows , localShadowQuality ! = LightShadows . None ) ;
CoreUtils . SetKeyword ( cmd , LightweightKeywordString s . SoftShadows , hasSoftShadows ) ;
// TODO: Remove this. legacy particles support will be removed from Unity in 2018.3. This should be a shader_feature instead with prop exposed in the Standard particles shader.
CoreUtils . SetKeyword ( cmd , "SOFTPARTICLES_ON" , cameraData . requiresSoftParticles ) ;
if ( cameraData . msaaSamples > 1 )
{
cmd . DisableShaderKeyword ( LightweightKeywords . DepthNoMsaa ) ;
cmd . DisableShaderKeyword ( LightweightKeywordString s . DepthNoMsaa ) ;
cmd . DisableShaderKeyword ( LightweightKeywords . DepthMsaa2 ) ;
cmd . EnableShaderKeyword ( LightweightKeywords . DepthMsaa4 ) ;
cmd . DisableShaderKeyword ( LightweightKeywordString s . DepthMsaa2 ) ;
cmd . EnableShaderKeyword ( LightweightKeywordString s . DepthMsaa4 ) ;
cmd . EnableShaderKeyword ( LightweightKeywords . DepthMsaa2 ) ;
cmd . DisableShaderKeyword ( LightweightKeywords . DepthMsaa4 ) ;
cmd . EnableShaderKeyword ( LightweightKeywordString s . DepthMsaa2 ) ;
cmd . DisableShaderKeyword ( LightweightKeywordString s . DepthMsaa4 ) ;
cmd . EnableShaderKeyword ( LightweightKeywords . DepthNoMsaa ) ;
cmd . DisableShaderKeyword ( LightweightKeywords . DepthMsaa2 ) ;
cmd . DisableShaderKeyword ( LightweightKeywords . DepthMsaa4 ) ;
cmd . EnableShaderKeyword ( LightweightKeywordString s . DepthNoMsaa ) ;
cmd . DisableShaderKeyword ( LightweightKeywordString s . DepthMsaa2 ) ;
cmd . DisableShaderKeyword ( LightweightKeywordString s . DepthMsaa4 ) ;
LightweightPipeline . CopyTexture ( cmd , depthSurface , copyDepthSurface , m_DepthCopyMaterial ) ;
}
context . ExecuteCommandBuffer ( cmd ) ;