原因
插件没有设置海面透明度的功能,修改shader可以修改透明度
解决方案
关键代码
Shader: Ocean.shader
Shader "Crest/Ocean"
{
SubShader
{
Pass
{
half4 Frag(const Varyings input, const bool i_isFrontFace : SV_IsFrontFace) : SV_Target
{
// ...
return half4(col, 1.);
}
}
}
}
增加支持透明
复制Ocean.shader
,修改复制后的shader
Shader "Crest/OceanAlpha"
{
Properties
{
[Header(Main)]
_ColorAlpha( "Color Alpha", Range(0.0, 1.0) ) = 1.0
// ...
}
SubShader
{
Pass
{
// 深度写入关闭
ZWrite Off
// 混合参数
Blend SrcAlpha OneMinusSrcAlpha
// ...
half4 Frag(const Varyings input, const bool i_isFrontFace : SV_IsFrontFace) : SV_Target
{
// ...
return half4(col, _ColorAlpha);
}
}
}
}