浏览代码

HDRenderPipeline: Don't add keyword _BLENDMODE_PRESERVE_SPECULAR_LIGHTING if material is not transparent

/main
sebastienlagarde 7 年前
当前提交
4a2a867b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs


SurfaceType surfaceType = (SurfaceType)material.GetFloat(kSurfaceType);
CoreUtils.SetKeyword(material, "_SURFACE_TYPE_TRANSPARENT", surfaceType == SurfaceType.Transparent);
bool enableBlendModePreserveSpecularLighting = material.HasProperty(kEnableBlendModePreserveSpecularLighting) && material.GetFloat(kEnableBlendModePreserveSpecularLighting) > 0.0f;
bool enableBlendModePreserveSpecularLighting = (surfaceType == SurfaceType.Transparent) && material.HasProperty(kEnableBlendModePreserveSpecularLighting) && material.GetFloat(kEnableBlendModePreserveSpecularLighting) > 0.0f;
CoreUtils.SetKeyword(material, "_BLENDMODE_PRESERVE_SPECULAR_LIGHTING", enableBlendModePreserveSpecularLighting);
// These need to always been set either with opaque or transparent! So a users can switch to opaque and remove the keyword correctly

正在加载...
取消
保存