浏览代码

- "Opacity As Density" mode is now a checkbox

- Fixed Density mode when using Height based blend.
/main
Julien Ignace 7 年前
当前提交
26608503
共有 3 个文件被更改,包括 16 次插入15 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  3. 15
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

8
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


_InheritBaseColor2("_InheritBaseColor2", Range(0, 1.0)) = 0.0
_InheritBaseColor3("_InheritBaseColor3", Range(0, 1.0)) = 0.0
_OpacityAsDensity0("_OpacityAsDensity0", Range(0, 1.0)) = 0.0
_OpacityAsDensity1("_OpacityAsDensity1", Range(0, 1.0)) = 0.0
_OpacityAsDensity2("_OpacityAsDensity2", Range(0, 1.0)) = 0.0
_OpacityAsDensity3("_OpacityAsDensity3", Range(0, 1.0)) = 0.0
[ToggleOff] _OpacityAsDensity0("_OpacityAsDensity0", Float) = 0.0
[ToggleOff] _OpacityAsDensity1("_OpacityAsDensity1", Float) = 0.0
[ToggleOff] _OpacityAsDensity2("_OpacityAsDensity2", Float) = 0.0
[ToggleOff] _OpacityAsDensity3("_OpacityAsDensity3", Float) = 0.0
_LayerTilingBlendMask("_LayerTilingBlendMask", Float) = 1

8
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


_InheritBaseColor2("_InheritBaseColor2", Range(0, 1.0)) = 0.0
_InheritBaseColor3("_InheritBaseColor3", Range(0, 1.0)) = 0.0
_OpacityAsDensity0("_OpacityAsDensity0", Range(0, 1.0)) = 0.0
_OpacityAsDensity1("_OpacityAsDensity1", Range(0, 1.0)) = 0.0
_OpacityAsDensity2("_OpacityAsDensity2", Range(0, 1.0)) = 0.0
_OpacityAsDensity3("_OpacityAsDensity3", Range(0, 1.0)) = 0.0
[ToggleOff] _OpacityAsDensity0("_OpacityAsDensity0", Float) = 0.0
[ToggleOff] _OpacityAsDensity1("_OpacityAsDensity1", Float) = 0.0
[ToggleOff] _OpacityAsDensity2("_OpacityAsDensity2", Float) = 0.0
[ToggleOff] _OpacityAsDensity3("_OpacityAsDensity3", Float) = 0.0
_LayerTilingBlendMask("_LayerTilingBlendMask", Float) = 1

15
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


outWeights[i] = 0.0f;
}
#if defined(_DENSITY_MODE)
// Note: blendMasks.argb because a is main layer
float4 opacityAsDensity = saturate((inputAlphaMask - (float4(1.0, 1.0, 1.0, 1.0) - blendMasks.argb)) * 20.0); // 20.0 is the number of steps in inputAlphaMask (Density mask. We decided 20 empirically)
float4 useOpacityAsDensityParam = float4(_OpacityAsDensity0, _OpacityAsDensity1, _OpacityAsDensity2, _OpacityAsDensity3);
blendMasks.argb = lerp(blendMasks.argb, opacityAsDensity, useOpacityAsDensityParam);
#endif
#if defined(_HEIGHT_BASED_BLEND)
#if defined(_HEIGHTMAP0) || defined(_HEIGHTMAP1) || defined(_HEIGHTMAP2) || defined(_HEIGHTMAP3)

blendMasks = ApplyHeightBlend(heights, blendMasks);
#endif
// If no heightmap is set on any layer, we don't need to try and blend them based on height...
#endif
#if defined(_DENSITY_MODE)
// Note: blendMasks.argb because a is main layer
float4 opacityAsDensity = saturate((inputAlphaMask - (float4(1.0, 1.0, 1.0, 1.0) - blendMasks.argb)) * 20.0); // 20.0 is the number of steps in inputAlphaMask (Density mask. We decided 20 empirically)
float4 useOpacityAsDensityParam = float4(_OpacityAsDensity0, _OpacityAsDensity1, _OpacityAsDensity2, _OpacityAsDensity3);
blendMasks.argb = lerp(blendMasks.argb, opacityAsDensity, useOpacityAsDensityParam);
#endif
ComputeMaskWeights(blendMasks, outWeights);

正在加载...
取消
保存