Skip to content

Commit

Permalink
Update material.js
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi authored Oct 30, 2023
1 parent 8c8ec91 commit ea5475e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/webgl/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ p5.prototype.loadShader = function(
* // the fragment shader is called for each pixel
* let fs = `
* precision highp float;
* uniform vec2 p;
* uniform float r;
* const int I = 500;
* uniform vec2 p;
* uniform float r;
* const int I = 500;
* varying vec2 vTexCoord;
* void main() {
* vec2 c = p + gl_FragCoord.xy * r, z = c;
* float n = 0.0;
* for (int i = I; i > 0; i --) {
* if(z.x*z.x+z.y*z.y > 4.0) {
* n = float(i)/float(I);
* break;
* }
* z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c;
* }
* gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0);
* void main() {
* vec2 c = p + gl_FragCoord.xy * r, z = c;
* float n = 0.0;
* for (int i = I; i > 0; i --) {
* if(z.x*z.x+z.y*z.y > 4.0) {
* n = float(i)/float(I);
* break;
* }
* z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c;
* }
* gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0);
* }`;
*
* let mandel;
Expand Down

0 comments on commit ea5475e

Please sign in to comment.