experimental: simplify strands tutorial (flat API, no uniforms, no arrow fns)#1182
experimental: simplify strands tutorial (flat API, no uniforms, no arrow fns)#1182nbogie wants to merge 8 commits intoprocessing:2.0from
Conversation
base().modify() becomes buildXShader() removed all arrow fns except in the placeholder for millis() fix incorrect indenting of code spans js fenced blocks don't need initial indentation removing uniforms as far as possible from already flat-API tut. use noise() instead of defining a rand()
3f43457 to
6fe4553
Compare
|
(Minor note: |
|
Ta. (It looks like the build is breaking for unrelated reasons (401)) Update: at build, the site is pre-rendering pages for Nothing to do with this PR. |
|
Hi @nbogie ! Build is fixed and millis() should be in. |
…ie/p5.js-website into nb-strands-tut-both-simplifications
|
I've incorporated millis() again and stripped out the work-arounds. The only uniform mention is now for the texture for the bloom filter. |
|
Hi @nbogie ! I was just thinking about this, is it still in draft stage or can it be ready for review? Is it blocked by anything? |
|
Perhaps for now just read the updated code and see what you think of that, first, before doing any close review of the prose and explanation? If you are happy with the code, I can then spend more time on the text. I've deployed it here for convenience. The intended code simplification is done and tested. The prose needs a proofread. The main thing I don't like about the status of this PR is because I found we couldn't remove uniforms completely (needed just for the final bloom filter) we still need to address them properly, and I may have broken up that gradual intro by removing earlier examples. For now it is hand-waved in passing, only, as follows (The last sentence (untouched) also needs a re-think): Now:
I can of course add a para about what a uniform is, but if we're going to introduce them at all, it should really be done with a gradual series of examples. And guess what - that's what Luke had implemented, originally! Perhaps a compromise would be a little para on uniforms like this, asking for the reader's grace on the issue, something like:
(Also, I think that in replacing luke's custom-defined random() function with a use of the built-in noise() function, i've introduced a little bald spot in the animation's particle distribution! Nothing to see here! Best eventual solution would be a adding another random() function snippet to strands that has a uniform distribution and making use of that. The multi-octave noise function is neither uniform nor bound 0-1, I learned.) |
This is an experimental PR to allow us to see how the strands tutorial might look if simplified, and what problems we might encounter in trying that.
Status:
* Actually, you'll see two uses of uniform remaining:
a temporary one which serves to provide time (and keep sketches working) until millis() is implemented in strands. (added as a separate commit which can be reverted).
uniformTexture, used to get the original image into the bloom filter. I don't have a solution for how to remove this one and keep the bloom filter.ISSUE: The uniform mechanism being used by
uniformTextureis yet to be explained in this branch.