浏览代码

Rename SahderPreprocessorMaterial to BaseShaderPreprocessor

/main
sebastienlagarde 6 年前
当前提交
23e50c80
共有 9 个文件被更改,包括 12 次插入12 次删除
  1. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs
  2. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitShaderPreprocessor.cs
  3. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/StackLitShaderPreprocessor.cs
  4. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitShaderPreprocessor.cs
  5. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs
  6. 6
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorUtils.cs
  7. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/RenderPipelineSettingsUI.cs
  8. 0
      /com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs.meta
  9. 0
      /com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs

4
com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs


m_StripperFuncs = new Dictionary<string, VariantStrippingFunc>();
List<ShaderPreprocessorMaterial> materialList = HDEditorUtils.GetShaderPreprocessorMaterialList();
List<BaseShaderPreprocessor> materialList = HDEditorUtils.GetBaseShaderPreprocessorList();
foreach (ShaderPreprocessorMaterial material in materialList)
foreach (BaseShaderPreprocessor material in materialList)
{
material.AddStripperFuncs(m_StripperFuncs);
}

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitShaderPreprocessor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class LitShaderPreprocessor : ShaderPreprocessorMaterial
public class LitShaderPreprocessor : BaseShaderPreprocessor
{
bool LitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData)
{

bool isGBufferPass = snippet.passName == "GBuffer";
bool isForwardPass = snippet.passName == "Forward";
bool isTransparentForwardPass = snippet.passName == "TransparentDepthPostpass" || snippet.passName == "TransparentBackface" || snippet.passName == "TransparentDepthPrepass";
bool isTransparentForwardPass = snippet.passName == "TransparentDepthPostpass" || snippet.passName == "TransparentBackface" || snippet.passName == "TransparentDepthPrepass";
// When using forward only, we never need GBuffer pass (only Forward)
if (hdrpAsset.renderPipelineSettings.supportOnlyForward && isGBufferPass)

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/StackLitShaderPreprocessor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class StackLitShaderPreprocessor : ShaderPreprocessorMaterial
public class StackLitShaderPreprocessor : BaseShaderPreprocessor
{
bool StackLitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData)
{

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitShaderPreprocessor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class UnlitShaderPreprocessor : ShaderPreprocessorMaterial
public class UnlitShaderPreprocessor : BaseShaderPreprocessor
{
bool UnlitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData)
{

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs


// returns true if the variant should be stripped.
public delegate bool VariantStrippingFunc(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData);
public class ShaderPreprocessorMaterial
public class BaseShaderPreprocessor
{
protected ShaderKeyword m_ShadowMask;
protected ShaderKeyword m_Transparent;

public ShaderPreprocessorMaterial()
public BaseShaderPreprocessor()
{
m_Transparent = new ShaderKeyword("_SURFACE_TYPE_TRANSPARENT");
m_DebugDisplay = new ShaderKeyword("DEBUG_DISPLAY");

6
com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorUtils.cs


return false;
}
public static List<ShaderPreprocessorMaterial> GetShaderPreprocessorMaterialList()
public static List<BaseShaderPreprocessor> GetBaseShaderPreprocessorList()
var baseType = typeof(ShaderPreprocessorMaterial);
var baseType = typeof(BaseShaderPreprocessor);
.Cast<ShaderPreprocessorMaterial>()
.Cast<BaseShaderPreprocessor>()
.ToList();
return types;

2
com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/RenderPipelineSettingsUI.cs


EditorGUILayout.PropertyField(d.supportStereo, _.GetContent("Support Stereo Rendering"));
EditorGUILayout.PropertyField(d.enableUltraQualitySSS, _.GetContent("Increase SSS Sample Count|This allow better SSS quality. Warning: Slow feature, don't use for game."));
EditorGUILayout.PropertyField(d.supportVolumetric, _.GetContent("Support volumetric|Enable memory and shader variant for volumetric."));
EditorGUILayout.PropertyField(d.supportRuntimeDebugDisplay, _.GetContent("Support debug display|Remove all debug display shader variant only in the player. Allow faster build."));
EditorGUILayout.PropertyField(d.supportRuntimeDebugDisplay, _.GetContent("Support runtime debug display|Remove all debug display shader variant only in the player. Allow faster build."));
--EditorGUI.indentLevel;
}

/com.unity.render-pipelines.high-definition/HDRP/Editor/Material/ShaderPreprocessorMaterial.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Editor/Material/ShaderPreprocessorMaterial.cs → /com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs

正在加载...
取消
保存