From 8bba60772f8217233852459879952a55bef87afa Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sat, 5 Feb 2022 16:23:49 +0000 Subject: [PATCH] WS30: Initial shoreline shader Using steepness to create a shoreline --- Shaders/ws30-ALS-ultra.frag | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shaders/ws30-ALS-ultra.frag b/Shaders/ws30-ALS-ultra.frag index 8b2df9980..9ebf488c1 100644 --- a/Shaders/ws30-ALS-ultra.frag +++ b/Shaders/ws30-ALS-ultra.frag @@ -443,7 +443,11 @@ void main() if ((water_shader == 1) && (fg_photoScenery == false) && fg_materialParams3[lc].x > 0.5) { // This is a water fragment, so calculate the fragment color procedurally - texel = generateWaterTexel(); + // and mix with some sand colour if near an edge + //bool adjacentwater = fg_materialParams3[lc_n.x].x > 0.5; + //texel = mix(generateWaterTexel(), texel, adjacentwater ? 0.0 : smoothstep(0.1, 0.2, mfact[0])); + //texel = mix(generateWaterTexel(), vec4(0.6,0.6,0.4,1.0), adjacentwater ? 0.0 : smoothstep(0.1, 0.2, mfact[0])); + texel = mix(vec4(0.6,0.6,0.4,1.0), generateWaterTexel(), smoothstep(0.98,1.0,steepness)); fragColor = texel; fragColor.rgb += getClusteredLightsContribution(ecPosition.xyz, n, fragColor.rgb); } else {