1
1
let myShader ;
2
- let myShader2 ;
3
2
3
+ let myShader2 ;
4
4
p5 . disableFriendlyErrors = true ;
5
5
function windowResized ( ) {
6
6
resizeCanvas ( windowWidth , windowHeight ) ;
@@ -18,15 +18,15 @@ function setup(){
18
18
createCanvas ( windowWidth , windowHeight , WEBGL ) ;
19
19
20
20
myShader = baseMaterialShader ( ) . modify ( ( ) => {
21
- const uCol = uniformVector4 ( 1 , 0 , 0 , 1 ) ;
22
- const time = uniformFloat ( ( ) => millis ( ) ) ;
23
- getFinalColor ( ( color ) => {
24
- color = uCol ;
25
- color . y = 1 ;
26
- let x = createVector4 ( time ) ;
27
- x . x += createFloat ( 2 ) ;
28
- color += x ;
29
- return color ;
21
+
22
+ const offset = uniformFloat ( 1 ) ;
23
+
24
+ getFinalColor ( ( col ) => {
25
+ let a = createVector4 ( 1 , 2 , 3 , 4 ) ;
26
+ let b = createVector4 ( 3 , 4 , 5 , 6 ) ;
27
+ a = ( a * b + offset ) / 10 ;
28
+ col += a ;
29
+ return col ;
30
30
} ) ;
31
31
// getWorldInputs((Inputs) => {
32
32
// console.log(Inputs)
@@ -35,25 +35,6 @@ function setup(){
35
35
}
36
36
37
37
function draw ( ) {
38
- background ( 0 ) ;
39
- shader ( myShader ) ;
40
- fill ( 0 , 0 , 0 )
41
- sphere ( 100 ) ;
38
+ // Set the styles
39
+ background ( 0 )
42
40
}
43
-
44
- `(vec4 color) {
45
- // From at <computed> [as uniformVector4] (http://localhost:5173/p5.js:86002:25)
46
- vec4 temp_0 = uCol;
47
- temp_0 = vec4(temp_0.x, 1.0000, temp_0.z, temp_0.w);
48
- vec4 finalReturnValue = temp_0;
49
- return finalReturnValue;
50
- }`
51
- `
52
- (vec4 color) {
53
-
54
- // From at <computed> [as uniformVector4] (http://localhost:5173/p5.js:86002:25)
55
- vec4 temp_0 = uCol;
56
- temp_0 = vec4(temp_0.x, 1.0000, temp_0.z, temp_0.w);
57
- vec4 finalReturnValue = temp_0 + vec4(0.0000 + 2.0000, 0.0000, 0.0000, 0.0000);
58
- return finalReturnValue;
59
- }`
0 commit comments