@@ -2,28 +2,26 @@ p5.disableFriendlyErrors = true;
2
2
function windowResized ( ) {
3
3
resizeCanvas ( windowWidth , windowHeight ) ;
4
4
}
5
-
6
5
let myShader ;
7
6
8
- function myCol ( ) {
9
- const col = ( sin ( millis ( ) * 0.001 ) + 1 ) / 2 ;
10
- return col ;
11
- }
12
-
13
7
function setup ( ) {
14
8
createCanvas ( windowWidth , windowHeight , WEBGL ) ;
9
+
15
10
myShader = baseMaterialShader ( ) . modify ( ( ) => {
16
- const time = uniformFloat ( ( ) => sin ( millis ( ) * 0.001 ) ) ;
11
+ const time = uniformFloat ( ( ) => millis ( ) ) ;
12
+
17
13
getFinalColor ( ( col ) => {
18
14
col . x = uvCoords ( ) . x ;
19
15
col . y = uvCoords ( ) . y ;
16
+ col . z = 1 ;
20
17
return col ;
21
18
} ) ;
19
+
22
20
getWorldInputs ( ( inputs ) => {
23
- inputs . position . x += time * inputs . position . y ;
21
+ inputs . position . y += 20 * sin ( time * 0.001 + inputs . position . x * 0.05 ) ;
24
22
return inputs ;
25
23
} )
26
- } , { parser : true , srcLocations : false } ) ;
24
+ } ) ;
27
25
}
28
26
29
27
function draw ( ) {
@@ -34,20 +32,3 @@ function draw(){
34
32
fill ( 255 , 0 , 0 )
35
33
sphere ( 100 ) ;
36
34
}
37
-
38
- // `(vec4 color) {
39
- // // From at <computed> [as uniformVector4] (http://localhost:5173/p5.js:86002:25)
40
- // vec4 temp_0 = uCol;
41
- // temp_0 = vec4(temp_0.x, 1.0000, temp_0.z, temp_0.w);
42
- // vec4 finalReturnValue = temp_0;
43
- // return finalReturnValue;
44
- // }`
45
- // `
46
- // (vec4 color) {
47
-
48
- // // From at <computed> [as uniformVector4] (http://localhost:5173/p5.js:86002:25)
49
- // vec4 temp_0 = uCol;
50
- // temp_0 = vec4(temp_0.x, 1.0000, temp_0.z, temp_0.w);
51
- // vec4 finalReturnValue = temp_0 + vec4(0.0000 + 2.0000, 0.0000, 0.0000, 0.0000);
52
- // return finalReturnValue;
53
- // }`
0 commit comments