bamboo shoots bg
This commit is contained in:
parent
2541a6d96c
commit
de6f05f382
1 changed files with 57 additions and 8 deletions
65
src/Arts.cs
65
src/Arts.cs
|
@ -86,14 +86,63 @@ static class Arts
|
||||||
);
|
);
|
||||||
|
|
||||||
// bamboo
|
// bamboo
|
||||||
Mesh.Cube.Draw(
|
for (int i = -12; i <= 12; i++)
|
||||||
mat_unlit,
|
{
|
||||||
Matrix.TS(
|
float z_offset = Noise.s_scalar_x(i) * 2.0f;
|
||||||
V.XYZ(0, 1, -5),
|
float x_offset = Noise.s_scalar_x(i + 32) * 0.2f;
|
||||||
V.XYZ(0.1f, 2, 0.1f)
|
float x_wind = Maths.smooth_stop(Maths.u_scalar(SKMath.Sin((i * 0.16f) - Time.Totalf)));
|
||||||
),
|
Vec3[] p = new Vec3[] {
|
||||||
Color.Hex(0xB9E7AFFF)
|
V.XYZ(i * 0.3f, 0, -10 + z_offset),
|
||||||
);
|
V.XYZ(i * 0.3f, 1, -10 + z_offset),
|
||||||
|
|
||||||
|
V.XYZ(i * 0.3f, 4, -10 + z_offset),
|
||||||
|
V.XYZ(i * 0.3f + x_offset + x_wind, 5, -10 + z_offset),
|
||||||
|
};
|
||||||
|
|
||||||
|
// debug bezier points
|
||||||
|
// for (int i = 0; i < p.Length; i++)
|
||||||
|
// {
|
||||||
|
// Mesh.Sphere.Draw(
|
||||||
|
// mat_justcolor,
|
||||||
|
// Matrix.TS(
|
||||||
|
// p[i],
|
||||||
|
// 2 * U.mm
|
||||||
|
// ),
|
||||||
|
// Color.White
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ground bump
|
||||||
|
// Mesh.Sphere.Draw(
|
||||||
|
// mat_justcolor,
|
||||||
|
// Matrix.TS(
|
||||||
|
// box_mount,
|
||||||
|
// 3 * U.mm
|
||||||
|
// ),
|
||||||
|
// Color.Hex(0x959493FF).ToLinear()
|
||||||
|
// );
|
||||||
|
|
||||||
|
int steps = 92;
|
||||||
|
Vec3 pastPos = p[0];
|
||||||
|
float pastThc = 0.0f;
|
||||||
|
for (int j = 0; j < steps; j++)
|
||||||
|
{
|
||||||
|
float t = (float)j / (steps - 1);
|
||||||
|
Vec3 a = Vec3.Lerp(p[0], p[1], t);
|
||||||
|
Vec3 b = Vec3.Lerp(p[1], p[2], t);
|
||||||
|
Vec3 c = Vec3.Lerp(p[2], p[3], t);
|
||||||
|
Vec3 pos = Vec3.Lerp(Vec3.Lerp(a, b, t), Vec3.Lerp(b, c, t), t);
|
||||||
|
float thc = (1.0f + Maths.precision((1.0f - t), Maths.lerp(0.1f, 0.2f, Noise.u_scalar_x(i))) * 2.0f) * U.cm * 6.0f;
|
||||||
|
Lines.Add(
|
||||||
|
pastPos,
|
||||||
|
pos,
|
||||||
|
thc != pastThc ? Color.Hex(0x959493FF).ToLinear() : Color.Hex(0xB9E7AFFF).ToLinear(),
|
||||||
|
thc
|
||||||
|
);
|
||||||
|
pastPos = pos;
|
||||||
|
pastThc = thc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// unit cube
|
// unit cube
|
||||||
// Mesh.Cube.Draw(
|
// Mesh.Cube.Draw(
|
||||||
|
|
Loading…
Add table
Reference in a new issue