浏览代码

Property check on material property

/Yibing-Project-2
Frédéric Vauchelles 7 年前
当前提交
74ced4de
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
  3. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs


SetKeyword(material, "_TESSELLATION_PHONG", tessMode == TessellationMode.Phong);
}
var isPrePass = material.HasProperty(kPrePrefractionPass) && material.GetFloat(kPrePrefractionPass) > 0.0;
var isPrePass = material.HasProperty(kPreRefractionPass) && material.GetFloat(kPreRefractionPass) > 0.0;
SetKeyword(material, "_REFRACTION_ON", !isPrePass); // Refraction is not available for pre refraction (color buffer cannot be fetched)
}

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs


EditorGUILayout.LabelField(StylesBaseUnlit.TransparencyInputsText, EditorStyles.boldLabel);
++EditorGUI.indentLevel;
var isPrePass = material.GetFloat(kPrePrefractionPass) > 0.0;
var isPrePass = material.HasProperty(kPreRefractionPass) && material.GetFloat(kPreRefractionPass) > 0.0;
if (refractionMode != null
// Refraction is not available for pre-refraction objects
&& !isPrePass)

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


protected MaterialProperty distortionBlurRemapMax = null;
protected const string kDistortionBlurRemapMax = "_DistortionBlurRemapMax";
protected MaterialProperty preRefractionPass = null;
protected const string kPrePrefractionPass = "_PreRefractionPass";
protected const string kPreRefractionPass = "_PreRefractionPass";
// See comment in LitProperties.hlsl
const string kEmissionColor = "_EmissionColor";

distortionBlurScale = FindProperty(kDistortionBlurScale, props, false);
distortionBlurRemapMin = FindProperty(kDistortionBlurRemapMin, props, false);
distortionBlurRemapMax = FindProperty(kDistortionBlurRemapMax, props, false);
preRefractionPass = FindProperty(kPrePrefractionPass, props, false);
preRefractionPass = FindProperty(kPreRefractionPass, props, false);
}
void SurfaceTypePopup()

{
material.SetOverrideTag("RenderType", "Transparent");
material.SetInt("_ZWrite", 0);
var isPrePass = material.GetFloat(kPrePrefractionPass) > 0.0f;
var isPrePass = material.HasProperty(kPreRefractionPass) && material.GetFloat(kPreRefractionPass) > 0.0f;
material.renderQueue = (int)(isPrePass ? HDRenderQueue.PreRefraction : HDRenderQueue.Transparent);
SetKeyword(material, "_BLENDMODE_LERP", BlendMode.Lerp == blendMode);

正在加载...
取消
保存