You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This enhancement is part of the effort to integrate p5.strands more integrated into the core library (see parent issue #7849)
Most appropriate sub-area of p5.js?
Accessibility
Color
Core/Environment/Rendering
Data
DOM
Events
Image
IO
Math
Typography
Utilities
WebGL
Build process
Unit testing
Internationalization
Friendly errors
Other (specify if possible)
Feature enhancement details
A noise implementation in p5.strands would allow for a lot of interesting effects using p5.strands, for animating objects and rendering materials. This could be a GLSL implementation of simplex noise, or another algorithm.
In order to get this working, something similar to getTexture could be a good approach. That function is defined here in strands and also here in GLSL. This would mean making a new function call node in strands, and writing the GLSL function somewhere to be included in shaders. I would be inclined to make this a new GLSL file, since we might add more functions to it in the future.
The implementation can be different than the core library version of noise, with potential to add a noiseMode(GPU || CPU) in the future.
The text was updated successfully, but these errors were encountered:
Some noise approaches use a big table of noise values, but we probably don't want to use that for now if we're going to be adding this helper function to all shaders
Potentially in the future, we can conditionally add it only if a shader makes use of it, but if our implementation is small, it's OK not doing that yet
If we're borrowing a GLSL noise implementation from the internet, that could be OK but we should be explicit about it and discuss what its software license is
A lot of references to noise functions that you see only implement base noise. p5's noise() uses fractal noise, which looks something like this:
for (int i =0; i <3; i++) {
result +=pow(2.0, -float(i)) * baseNoise(input *pow(2.0, float(i)));
}
In p5 the factors are controlled by noiseDetail, but it's also OK to just hardcode the default values for now and connect it to noiseDetail in a later update.
Increasing access
This enhancement is part of the effort to integrate p5.strands more integrated into the core library (see parent issue #7849)
Most appropriate sub-area of p5.js?
Feature enhancement details
A noise implementation in p5.strands would allow for a lot of interesting effects using p5.strands, for animating objects and rendering materials. This could be a GLSL implementation of simplex noise, or another algorithm.
In order to get this working, something similar to
getTexture
could be a good approach. That function is defined here in strands and also here in GLSL. This would mean making a new function call node in strands, and writing the GLSL function somewhere to be included in shaders. I would be inclined to make this a new GLSL file, since we might add more functions to it in the future.The implementation can be different than the core library version of noise, with potential to add a
noiseMode(GPU || CPU)
in the future.The text was updated successfully, but these errors were encountered: