wip
This commit is contained in:
parent
d511a39178
commit
3611612d47
1 changed files with 1 additions and 6 deletions
|
|
@ -5,14 +5,9 @@
|
||||||
|
|
||||||
@fragment
|
@fragment
|
||||||
fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
|
fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
|
||||||
// very simple vertical gradient between two colors
|
|
||||||
let bottom = vec3<f32>(1.0, 0.8, 0.2); // warm
|
let bottom = vec3<f32>(1.0, 0.8, 0.2); // warm
|
||||||
let top = vec3<f32>(0.2, 0.6, 1.0); // cool
|
let top = vec3<f32>(0.2, 0.6, 1.0); // cool
|
||||||
|
|
||||||
// use time to subtly shift the gradient
|
let color = mix(bottom, top, mesh.uv.y);
|
||||||
let t = u_time;
|
|
||||||
let shift = 0.2 * sin(t);
|
|
||||||
|
|
||||||
let color = mix(bottom, top, mesh.uv.y + shift);
|
|
||||||
return vec4<f32>(color, 1.0);
|
return vec4<f32>(color, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue