浏览代码

Removed _METALLIC_SETUP dependency. Now if _SPECULAR_SETUP is not defined MetallicSetup is used.

/Add-support-for-light-specular-color-tint
Felipe Lira 7 年前
当前提交
28ba8394
共有 3 个文件被更改,包括 7 次插入7 次删除
  1. 1
      ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardGUI.cs
  2. 8
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc
  3. 5
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader

1
ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardGUI.cs


hasGlossMap = material.GetTexture("_MetallicGlossMap");
LightweightShaderHelper.SetKeyword(material, "_SPECULAR_SETUP", isSpecularWorkFlow);
LightweightShaderHelper.SetKeyword(material, "_METALLIC_SETUP", !isSpecularWorkFlow);
LightweightShaderHelper.SetKeyword(material, "_METALLICSPECGLOSSMAP", hasGlossMap);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", hasGlossMap && isSpecularWorkFlow);

8
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc


half4 specGloss = MetallicSpecGloss(uv, albedoAlpha);
outSurfaceData.albedo = LIGHTWEIGHT_GAMMA_TO_LINEAR(albedoAlpha.rgb) * _Color.rgb;
#if _METALLIC_SETUP
outSurfaceData.metallic = specGloss.r;
outSurfaceData.specular = half3(0.0h, 0.0h, 0.0h);
#else
#if _SPECULAR_SETUP
#else
outSurfaceData.metallic = specGloss.r;
outSurfaceData.specular = half3(0.0h, 0.0h, 0.0h);
#endif
outSurfaceData.smoothness = specGloss.a;

5
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader


#pragma target 3.0
// -------------------------------------
#pragma shader_feature _METALLIC_SETUP _SPECULAR_SETUP
#pragma shader_feature _OCCLUSIONMAP
#pragma shader_feature _OCCLUSIONMAP
#pragma shader_feature _SPECULAR_SETUP
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT _MAIN_POINT_LIGHT
#pragma multi_compile _ _ADDITIONAL_LIGHTS

正在加载...
取消
保存