浏览代码

Move _surface_type_transparent definition to BaseUnlitUI.cs

/Yibing-Project-2
Sebastien Lagarde 7 年前
当前提交
d5855c4e
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs
  2. 1
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/UnlitUI.cs

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


public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff");
public static GUIContent alphaCutoffShadowText = new GUIContent("Alpha Cutoff Shadow", "Threshold for alpha cutoff in case of shadow pass");
public static GUIContent alphaCutoffPrepassText = new GUIContent("Alpha Cutoff Prepass", "Threshold for alpha cutoff in case of depth prepass");
public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to ");
public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to ");
public static GUIContent enableFogText = new GUIContent("Enable Fog");
public static GUIContent doubleSidedEnableText = new GUIContent("Double Sided", "This will render the two face of the objects (disable backface culling) and flip/mirror normal");

SurfaceType surfaceType = (SurfaceType)material.GetFloat(kSurfaceType);
BlendMode blendMode = (BlendMode)material.GetFloat(kBlendMode);
SetKeyword(material, "_SURFACE_TYPE_TRANSPARENT", surfaceType == SurfaceType.Transparent);
// These need to always been set either with opaque or transparent! So a users can switch to opaque and remove the keyword correctly
SetKeyword(material, "_BLENDMODE_ALPHA", false);
SetKeyword(material, "_BLENDMODE_ADD", false);

SetKeyword(material, "_ENABLE_FOG", fogEnabled);
if (material.HasProperty(kDistortionEnable))
{
{
bool distortionDepthTest = material.GetFloat(kDistortionDepthTest) > 0.0f;
if (distortionDepthTest)
{

// If distortion only is enabled, disable all passes (except distortion and debug)
bool enablePass = !(distortionEnable && distortionOnly);
// Disable all passes except distortion
// Distortion is setup in code above
material.SetShaderPassEnabled(HDShaderPassNames.s_ForwardStr, enablePass);

1
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/UnlitUI.cs


SetupBaseUnlitKeywords(material);
SetupBaseUnlitMaterialPass(material);
SetKeyword(material, "SURFACE_TYPE_TRANSPARENT", (SurfaceType)material.GetFloat(kSurfaceType) == SurfaceType.Transparent);
SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
}
}
正在加载...
取消
保存