-
Notifications
You must be signed in to change notification settings - Fork 14
Effect_BackLighting
XiaGu edited this page Apr 17, 2019
·
8 revisions
Back side render of water material.
Mode Artistic:
Property | Function |
---|---|
Color | Color of the surface. |
SpecularPow | Specular power. |
SpecularColor | SpecularColor color. |
ShadowAttenuation | The intensity of the water receive shadow, the smaller the value, the stronger the shadow. |
FresnelTexture | Fresnel intensity map, use only alpha channel. |
FresneIntensity | Fresnel intensity. |
FresnelColor | Fresnel color. |
half3 GetOceanBackArtisticLighting(half3 worldNormal, half3 worldViewDir, half3 lightDirection, half3 lightColor, float shadowAtten)
{
half3 diffuse = max(0, dot(worldNormal, lightDirection)) * lightColor;
half3 ambient = saturate(ShadeSH9(half4(worldNormal, 1.0)));
half3 specular = pow(max(0, dot(lightDirection, -worldViewDir)), SpecularPow) * SpecularColor * lightColor;
half fresnel = tex2D(FresnelTexture, half4(max(0, dot(worldViewDir, -worldNormal)), 0.5, 0, 0)).a;
fresnel = saturate(fresnel * FresneIntensity);
diffuse = lerp(diffuse, FresneColor, fresnel);
half3 color = Color;
color.rgb *= diffuse + ambient;
color.rgb += specular;
color.rgb *= saturate(shadowAtten + ShadowAttenuation);
}
Disable under water fog:
Enable under water fog:
Ocean Effects
Components