fix: HouseOfLeaves sand setup

This commit is contained in:
Alexandre Coirier
2026-06-03 01:15:15 +02:00
parent c0f7f805f3
commit adb1512ab3
6 changed files with 425 additions and 30 deletions
@@ -117,7 +117,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Progression: 0.217
- _Progression: 0
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
@@ -28,10 +28,11 @@ void Sand_float
// Arks
float arkMask = abs(frac(PositionWS.z * .5) * 2 - 1);
/*float arkMask = abs(frac(PositionWS.z * .5) * 2 - 1);
arkMask = pow(smoothstep(.7, 0, arkMask), 2);
arkMask += smoothstep(2.8, 3.2, abs(PositionWS.x));
arkMask = saturate(arkMask);
arkMask = saturate(arkMask);*/
float arkMask = 0;
// Sand
@@ -39,12 +40,14 @@ void Sand_float
float sandDirection = cos(t * sandLayers * 3.14);
float sandDensity = smoothstep(1.5, 0, abs(PositionWS.x));
sandDensity = saturate(sandDensity + arkMask);
//float sandDensity = smoothstep(1.5, 0, abs(PositionWS.x));
//sandDensity = saturate(sandDensity + arkMask);
float sandPatern = RidgedNoise3D(PositionWS + float3(sandDirection, 0, 0), .6, 1, 2, .5) * .8;
sandPatern += 1 - RidgedNoise3D(PositionWS + float3(0, 0, t * sandLayers * 2), .8, 2, 2, .5) * .2;
float sandDensity = sqrt(smoothstep(0, 2, abs(PositionWS.x) + sandPatern));
float sandGradientSign = (floor(t * sandLayers) % 2 == 0) ? 1 : -1;
float sandGradient = smoothstep(2 * -sandGradientSign, 2 * sandGradientSign, PositionWS.x);
float sandPhase = frac(t * sandLayers);