Use type inference in custom_shader WGSL (#334)
This commit is contained in:
parent
b54f707a59
commit
c3f63a540d
|
@ -24,13 +24,13 @@ struct Locals {
|
|||
}
|
||||
@group(0) @binding(2) var<uniform> r_locals: Locals;
|
||||
|
||||
const tau: f32 = 6.283185307179586476925286766559;
|
||||
const bias: f32 = 0.2376; // Offset the circular time input so it is never 0
|
||||
const tau = 6.283185307179586476925286766559;
|
||||
const bias = 0.2376; // Offset the circular time input so it is never 0
|
||||
|
||||
// Random functions based on https://thebookofshaders.com/10/
|
||||
const random_scale: f32 = 43758.5453123;
|
||||
const random_x: f32 = 12.9898;
|
||||
const random_y: f32 = 78.233;
|
||||
const random_scale = 43758.5453123;
|
||||
const random_x = 12.9898;
|
||||
const random_y = 78.233;
|
||||
|
||||
fn random(x: f32) -> f32 {
|
||||
return fract(sin(x) * random_scale);
|
||||
|
|
Loading…
Reference in a new issue