升级水插件
This commit is contained in:
@@ -50,7 +50,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
}
|
||||
},
|
||||
{
|
||||
"Crest/Underwater", new()
|
||||
UnderwaterRenderer.k_ShaderNameEffect, new()
|
||||
{
|
||||
{ "_Crest_ExtinctionMultiplier", "Scales the depth fog density. Useful to reduce the intensity of the depth fog when underwater only" },
|
||||
{ "_Crest_SunBoost", "Boost the intensity of the sun scattering" },
|
||||
@@ -149,7 +149,26 @@ namespace WaveHarmonic.Crest.Editor
|
||||
|
||||
internal static MaterialProperty[] FilterProperties(MaterialProperty[] properties)
|
||||
{
|
||||
return properties.Where(x => x.name != "_Crest_Absorption").ToArray();
|
||||
// Show specular control.
|
||||
var specular = true;
|
||||
|
||||
if (!RenderPipelineHelper.IsHighDefinition)
|
||||
{
|
||||
specular = properties
|
||||
.First(x => x.name == (RenderPipelineHelper.IsLegacy ? "_BUILTIN_WorkflowMode" : "_WorkflowMode")).floatValue == 0;
|
||||
}
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
else
|
||||
{
|
||||
// Always show specular control for U5, as it cannot be overriden by the material.
|
||||
specular = properties
|
||||
.First(x => x.name == "_MaterialID").floatValue == 4;
|
||||
}
|
||||
#endif
|
||||
|
||||
return properties
|
||||
.Where(x => (specular || x.name != "_Crest_Specular") && x.name != "_Crest_Absorption")
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +194,11 @@ namespace WaveHarmonic.Crest.Editor
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
#if UNITY_6000_2_OR_NEWER
|
||||
if ((property.propertyFlags & UnityEngine.Rendering.ShaderPropertyFlags.HideInInspector) != 0) continue;
|
||||
#else
|
||||
if ((property.flags & MaterialProperty.PropFlags.HideInInspector) != 0) continue;
|
||||
#endif
|
||||
|
||||
var name = property.name;
|
||||
s_Label.text = property.displayName;
|
||||
@@ -187,7 +210,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
}
|
||||
|
||||
#if d_UnityShaderGraph
|
||||
class LegacyCustomShaderGUI : UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInBaseShaderGUI
|
||||
class LegacyCustomShaderGUI : ShaderGraph.CustomBuiltInLitGUI
|
||||
{
|
||||
MaterialEditor _Editor;
|
||||
MaterialProperty[] _Properties;
|
||||
|
||||
Reference in New Issue
Block a user