@@ -49,10 +49,10 @@ pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderRes
49
49
. main_image ( color, frag_coord) ;
50
50
}
51
51
52
- pub struct Inputs {
53
- pub resolution : Vec3 ,
54
- pub time : f32 ,
55
- pub mouse : Vec4 ,
52
+ struct Inputs {
53
+ resolution : Vec3 ,
54
+ time : f32 ,
55
+ mouse : Vec4 ,
56
56
}
57
57
58
58
// a few utility functions
@@ -75,7 +75,7 @@ fn stroke(d: f32, w: f32, s: f32, i: f32) -> f32 {
75
75
}
76
76
// a simple palette
77
77
fn pal ( d : f32 ) -> Vec3 {
78
- 0.5 * ( ( TWO_PI * d * vec3 ( 2.0 , 2.0 , 1.0 ) + vec3 ( 0.0 , 1.4 , 0.0 ) ) . cos ( ) + Vec3 :: ONE )
78
+ 0.5 * ( ( TAU * d * vec3 ( 2.0 , 2.0 , 1.0 ) + vec3 ( 0.0 , 1.4 , 0.0 ) ) . cos ( ) + Vec3 :: ONE )
79
79
}
80
80
// 2d rotation matrix
81
81
fn uvr_rotate ( a : f32 ) -> Mat2 {
@@ -100,7 +100,7 @@ fn apollonian(uv: Vec2) -> Vec3 {
100
100
// a DEC is a configuration of 4 circles tangent to each other
101
101
// the easiest way to build the initial one it to construct a symetric Steiner Chain.
102
102
// http://mathworld.wolfram.com/SteinerChain.html
103
- let a: f32 = TWO_PI / 3. ;
103
+ let a: f32 = TAU / 3. ;
104
104
let ra: f32 = 1.0 + ( a * 0.5 ) . sin ( ) ;
105
105
let rb: f32 = 1.0 - ( a * 0.5 ) . sin ( ) ;
106
106
dec[ 0 ] = vec3 ( 0.0 , 0.0 , -1.0 / ra) ;
@@ -321,7 +321,7 @@ impl Inputs {
321
321
c
322
322
}
323
323
324
- pub fn main_image ( & mut self , frag_color : & mut Vec4 , frag_coord : Vec2 ) {
324
+ fn main_image ( & mut self , frag_color : & mut Vec4 , frag_coord : Vec2 ) {
325
325
let uv: Vec2 = ( frag_coord - self . resolution . xy ( ) * 0.5 ) / self . resolution . y ;
326
326
let ms: Vec4 = ( self . mouse - self . resolution . xyxy ( ) * 0.5 ) / self . resolution . y ;
327
327
* frag_color = self . scene ( uv * 4. , ms * 4. ) . extend ( 1.0 ) ;
0 commit comments