浏览代码

Various typo fix + disable extra pass if distortion only

/namespace
sebastienlagarde 7 年前
当前提交
fa6e0a3a
共有 4 个文件被更改,包括 34 次插入9 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  3. 24
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  4. 13
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs

4
ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs


public static readonly string s_SRPDefaultUnlitStr = "SRPDefaultUnlit";
public static readonly string s_MotionVectorsStr = "MotionVectors";
public static readonly string s_DistortionVectorsStr = "DistortionVectors";
public static readonly string s_TransparentDepthPrepassStr = "TransparentDepthPrepass";
public static readonly string s_TransparentDepthPrePassStr = "TransparentDepthPrepass";
public static readonly string s_TransparentDepthPostpassStr = "TransparentDepthPostpass";
public static readonly string s_TransparentDepthPostPassStr = "TransparentDepthPostpass";
public static readonly string s_MetaStr = "Meta";
public static readonly string s_ShadowCasterStr = "ShadowCaster";

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


_AlphaCutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_AlphaCutoffPostpass("_AlphaCutoffPostpass", Range(0.0, 1.0)) = 0.5
[ToggleOff] _TransparentBackfaceEnable("_TransparentBackfaceEnable", Float) = 0.0
[ToggleOff] _TransparentDepthPostpassEnable("_TransparentBackfaceEnable", Float) = 0.0
[ToggleOff] _TransparentDepthPostpassEnable("_TransparentDepthPostpassEnable", Float) = 0.0
// Transparency
[Enum(None, 0, Plane, 1, Sphere, 2)]_RefractionMode("Refraction Mode", Int) = 0

24
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


_AlphaCutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_AlphaCutoffPostpass("_AlphaCutoffPostpass", Range(0.0, 1.0)) = 0.5
[ToggleOff] _TransparentBackfaceEnable("_TransparentBackfaceEnable", Float) = 0.0
[ToggleOff] _TransparentDepthPostpassEnable("_TransparentBackfaceEnable", Float) = 0.0
[ToggleOff] _TransparentDepthPostpassEnable("_TransparentDepthPostpassEnable", Float) = 0.0
// Transparency
[Enum(None, 0, Plane, 1, Sphere, 2)]_RefractionMode("Refraction Mode", Int) = 0

#include "ShaderPass/LitSharePass.hlsl"
#include "LitData.hlsl"
#include "../../ShaderPass/ShaderPassForward.hlsl"
ENDHLSL
}
Pass
{
Name "TransparentDepthPostPass"
Tags { "LightMode" = "TransparentDepthPostPass" }
Cull[_CullMode]
ZWrite On
ColorMask 0
HLSLPROGRAM
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define CUTOFF_TRANSPARENT_DEPTH_POSTPASS
#include "../../ShaderVariables.hlsl"
#include "../../Material/Material.hlsl"
#include "ShaderPass/LitDepthPass.hlsl"
#include "LitData.hlsl"
#include "../../ShaderPass/ShaderPassDepthOnly.hlsl"
ENDHLSL
}

13
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs


material.SetShaderPassEnabled(HDShaderPassNames.s_GBufferDebugDisplayStr, true);
material.SetShaderPassEnabled(HDShaderPassNames.s_MotionVectorsStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_DistortionVectorsStr, distortionEnable); // note: use distortionEnable
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrepassStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrePassStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentBackfaceStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentBackfaceDebugDisplayStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPostPassStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_MetaStr, enablePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_ShadowCasterStr, enablePass);
}

bool depthWriteEnable = (material.GetFloat(kTransparentDepthPrepassEnable) > 0.0f) && ((SurfaceType)material.GetFloat(kSurfaceType) == SurfaceType.Transparent);
if (depthWriteEnable)
{
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrepassStr, true);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrePassStr, true);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrepassStr, false);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPrePassStr, false);
}
}

if (depthWriteEnable)
{
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPostpassStr, true);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPostPassStr, true);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPostpassStr, false);
material.SetShaderPassEnabled(HDShaderPassNames.s_TransparentDepthPostPassStr, false);
}
}

正在加载...
取消
保存