Adding the new createShader example #6134#1364
Adding the new createShader example #6134#1364thantr wants to merge 4 commits intoprocessing:mainfrom
Conversation
davepagurek
left a comment
There was a problem hiding this comment.
Thanks for making this! I just left some minor formatting comments, otherwise this is a cool example!
Just to double-check, @limzykenneth are these files all we need to add to the examples page?
| `; | ||
|
|
||
|
|
||
| let canvas; |
There was a problem hiding this comment.
I think from here to line 110 everything is indented an extra time, do you mind de-indenting this part?
|
|
||
| let screenSize; | ||
| let samples; | ||
| let targetC; |
There was a problem hiding this comment.
It might be good adding a comment on targetC and currentC explaining what they'll be used for (how they relate to the c we pass into the shader, and probably the fact that it's two components because it's a complex number)
| // Check to see how many iterations it takes for Z to be greater than the value 3 and setting it a colour accordingly, | ||
| for (int i = 0; i < iter_cap; ++i) { | ||
| if (dot(z, z) > 3.0) { | ||
| // If the series escapes, we calculatae 'value based on the iteration number of iterations it took that value to escape |
There was a problem hiding this comment.
tiny changes here: calculate has a typo, and did you want to say 'value' in quotes here to match line 64?
| // Define the screen size as a 2D vector | ||
| vec2 screenSize = vec2(710.0, 400.0); | ||
| // Get normalized screen space coordinates for the current pixel, | ||
| vec2 normd_pixel = (gl_FragCoord.xy/screenSize - 0.5) * 2.0; |
| // Uniforms are data that is the same for all pixels processed by the shader. | ||
| uniform vec2 c; // Complex number for fractal calculation | ||
| uniform vec2 screenSize; // Dimensions of the screen | ||
| uniform float hue; // Color hue |
There was a problem hiding this comment.
It looks like this goes unused, maybe we can take it out or make use of it?
|
Thanks @thantr for working on it. We'd like to follow up on this PR. Please let us know if you need any support responding to @davepagurek's comments. Thank you. |
for issue #6134
Changes:
Added the new createshader/Julia set example to the EN, ES, zh-Hans folders