浏览代码

HDRenderPipeline: PRovide correct default value for Amplitude property of displacement

/Yibing-Project-2
Sebastien Lagarde 7 年前
当前提交
ff69034b
共有 5 个文件被更改,包括 23 次插入17 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  2. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  3. 16
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
  4. 3
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  5. 3
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader

9
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


_HeightMap2("HeightMap2", 2D) = "black" {}
_HeightMap3("HeightMap3", 2D) = "black" {}
[HideInInspector] _HeightAmplitude0("Height Scale0", Float) = 1
[HideInInspector] _HeightAmplitude1("Height Scale1", Float) = 1
[HideInInspector] _HeightAmplitude2("Height Scale2", Float) = 1
[HideInInspector] _HeightAmplitude3("Height Scale3", Float) = 1
// Caution: Default value of _HeightAmplitude must be (_HeightMax - _HeightMin) * 0.01
[HideInInspector] _HeightAmplitude0("Height Scale0", Float) = 0.02
[HideInInspector] _HeightAmplitude1("Height Scale1", Float) = 0.02
[HideInInspector] _HeightAmplitude2("Height Scale2", Float) = 0.02
[HideInInspector] _HeightAmplitude3("Height Scale3", Float) = 0.02
_HeightCenter0("Height Bias0", Range(0.0, 1.0)) = 0.5
_HeightCenter1("Height Bias1", Range(0.0, 1.0)) = 0.5

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


_HeightMap2("HeightMap2", 2D) = "black" {}
_HeightMap3("HeightMap3", 2D) = "black" {}
[HideInInspector] _HeightAmplitude0("Height Scale0", Float) = 1
[HideInInspector] _HeightAmplitude1("Height Scale1", Float) = 1
[HideInInspector] _HeightAmplitude2("Height Scale2", Float) = 1
[HideInInspector] _HeightAmplitude3("Height Scale3", Float) = 1
// Caution: Default value of _HeightAmplitude must be (_HeightMax - _HeightMin) * 0.01
[HideInInspector] _HeightAmplitude0("Height Scale0", Float) = 0.02
[HideInInspector] _HeightAmplitude1("Height Scale1", Float) = 0.02
[HideInInspector] _HeightAmplitude2("Height Scale2", Float) = 0.02
[HideInInspector] _HeightAmplitude3("Height Scale3", Float) = 0.02
_HeightCenter0("Height Bias0", Range(0.0, 1.0)) = 0.5
_HeightCenter1("Height Bias1", Range(0.0, 1.0)) = 0.5

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


m_MaterialEditor.TexturePropertySingleLine(Styles.bentNormalMapOSText, bentNormalMapOS[layerIndex]);
}
EditorGUI.BeginChangeCheck();
EditorGUI.BeginChangeCheck();
if (EditorGUI.EndChangeCheck())
{
heightAmplitude[layerIndex].floatValue = (heightMax[layerIndex].floatValue - heightMin[layerIndex].floatValue) * 0.01f; // Conversion centimeters to meters.
}
// Note: We should only enclose min/max property here for change detection. However heightAmplitude may not be correctly initialize if default value was not correct
// force a refresh when the user setup a heightmap, so we are sure it is correct
if (EditorGUI.EndChangeCheck())
{
heightAmplitude[layerIndex].floatValue = (heightMax[layerIndex].floatValue - heightMin[layerIndex].floatValue) * 0.01f; // Conversion centimeters to meters.
}
if(materialID != null)
if (materialID != null)
{
switch ((Lit.MaterialId)materialID.floatValue)
{

else
{
m_MaterialEditor.ShaderProperty(UVDetail[layerIndex], Styles.UVDetailMappingText);
}
}
// Setup the UVSet for detail, if planar/triplanar is use for base, it will override the mapping of detail (See shader code)
X = ((UVDetailMapping)UVDetail[layerIndex].floatValue == UVDetailMapping.UV0) ? 1.0f : 0.0f;

3
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


_BentNormalMapOS("_BentNormalMapOS", 2D) = "white" {}
_HeightMap("HeightMap", 2D) = "black" {}
[HideInInspector] _HeightAmplitude("Height Amplitude", Float) = 0.01 // In world units. This will be computed in the UI.
// Caution: Default value of _HeightAmplitude must be (_HeightMax - _HeightMin) * 0.01
[HideInInspector] _HeightAmplitude("Height Amplitude", Float) = 0.02 // In world units. This will be computed in the UI.
_HeightMin("Heightmap Min", Float) = -1
_HeightMax("Heightmap Max", Float) = 1
_HeightCenter("Height Center", Range(0.0, 1.0)) = 0.5 // In texture space

3
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


_BentNormalMapOS("_BentNormalMapOS", 2D) = "white" {}
_HeightMap("HeightMap", 2D) = "black" {}
[HideInInspector] _HeightAmplitude("Height Amplitude", Float) = 0.01 // In world units
// Caution: Default value of _HeightAmplitude must be (_HeightMax - _HeightMin) * 0.01
[HideInInspector] _HeightAmplitude("Height Amplitude", Float) = 0.02 // In world units
_HeightCenter("Height Center", Range(0.0, 1.0)) = 0.5 // In texture space
_HeightMin("Heightmap Min", Float) = -1
_HeightMax("Heightmap Max", Float) = 1

正在加载...
取消
保存