wip: Postprocess

This commit is contained in:
Alexandre Coirier
2026-05-28 01:27:15 +02:00
parent 59d0721f91
commit f1f4c47b1c
5 changed files with 331 additions and 191 deletions
@@ -345,6 +345,46 @@ void EnkiBillal_float
// float stripes = WorldStripes();
// Test
//float test = ValueNoise3D(PositionWS, 40);
//float test = PerlinNoise3D(PositionWS, 40);
//float test = PerlinNoise3DLOD(PositionWS, 100, 3.5);
//float test = SimplexNoise3D(PositionWS, 40);
//float test = WorleyNoise3D(PositionWS, 40, 1);
//float id;
//float test = VoronoiNoise3D(PositionWS, 10, 1, .05, id);
//float test = FBMNoise3D(PositionWS, 10, 2, 2, .5);
//float test = RidgedNoise3D(PositionWS, 10, 2, 2, .5);
/*float3 pWS = scaledPositionOS;
float n0 = PerlinNoise3D(pWS, 2);
float distort = WorldDistort(pWS + n0 * .2, NormalWS, 1, TriplanarBlend);
float3 p = pWS + n0 * 2 + distort * smoothstep(.5, .7, n0) * .06;
float grad = 0;
float cell = 0;
VoronoiNoise3D_float(p, 2, 1, 1, grad, cell);
float3 v = cell * .8;// * (grad + distort * .1);
v += smoothstep(.05, .02, grad) * smoothstep(.4, .7, n0) * 2;
float3 c = Color * lerp(.9, 1, v);*/
// Output
//Output = 1;
//if (Step > 0 ) Output *= Color;
//if (Step > 1 ) Output *= grainAtten;
//if (Step > 2 ) Output *= dirtAtten;
//if (Step > 3 ) Output *= shadowAtten;
//if (Step > 4 ) Output = lerp(Output, Output * .1, stripes * .8);
Output = Color;
//Output = PerlinColor3D(PositionWS, 5);
//Output = smoothstep(.97, .93, ao);
// Mask
if (Mask2[0].w == 1)
@@ -359,13 +399,13 @@ void EnkiBillal_float
}
else
{
float Active = Mask0[0].w + Mask1[0].w;// + Mask2[0].w;
float Active = Mask0[0].w + Mask1[0].w; // + Mask2[0].w;
if (Active > 0)
{
float mask = saturate(
SampleProjectionMask(PositionWS, Mask0) +
SampleProjectionMask(PositionWS, Mask1)// +
SampleProjectionMask(PositionWS, Mask1) // +
//SampleProjectionMask(PositionWS, Mask2)
);
@@ -376,45 +416,6 @@ void EnkiBillal_float
Alpha = (MaskID == 1) ? 0 : 1;
}
}
// Test
//float test = ValueNoise3D(PositionWS, 40);
//float test = PerlinNoise3D(PositionWS, 40);
//float test = PerlinNoise3DLOD(PositionWS, 100, 3.5);
//float test = SimplexNoise3D(PositionWS, 40);
//float test = WorleyNoise3D(PositionWS, 40, 1);
//float id;
//float test = VoronoiNoise3D(PositionWS, 10, 1, .05, id);
//float test = FBMNoise3D(PositionWS, 10, 2, 2, .5);
//float test = RidgedNoise3D(PositionWS, 10, 2, 2, .5);
float3 pWS = scaledPositionOS;
float n0 = PerlinNoise3D(pWS, 2);
float distort = WorldDistort(pWS + n0 * .2, NormalWS, 1, TriplanarBlend);
float3 p = pWS + n0 * 2 + distort * smoothstep(.5, .7, n0) * .06;
float grad = 0;
float cell = 0;
VoronoiNoise3D_float(p, 2, 1, 1, grad, cell);
float3 v = cell * .8;// * (grad + distort * .1);
v += smoothstep(.05, .02, grad) * smoothstep(.4, .7, n0) * 2;
float3 c = Color * lerp(.9, 1, v);
// Output
//Output = 1;
//if (Step > 0 ) Output *= Color;
//if (Step > 1 ) Output *= grainAtten;
//if (Step > 2 ) Output *= dirtAtten;
//if (Step > 3 ) Output *= shadowAtten;
//if (Step > 4 ) Output = lerp(Output, Output * .1, stripes * .8);
Output = c;
//Output = PerlinColor3D(PositionWS, 5);
//Output = smoothstep(.97, .93, ao);
}
#endif