@aceslowman wrote:
I'm looking to use Perlin noise to create a flowing, 2D, fog-like effect. I understand that ofNoise is Perlin noise, but I am trying to figure out the right way to implement it and scale it properly.
My first thought was to use modulus to set the density, with 'fog' being an instance of ofPixels:
for(int x = 0; x < fog.getWidth(); x++){ for(int y = 0; y < fog.getHeight(); y++){ ofFloatColor t_col = ofFloatColor(0); t_col = ofLerp(0, noise,???); if(x % g_size == 0 && y % g_size == 0){ noise = ofNoise(x,y); } fog.setColor(x,y,t_col); } }
My thought was that I could set up a grid of these noise values, but I can't figure out how to properly interpolate between the two, let alone try to interpolate with a smoother curve or something. Does anyone have any advice? Would I be better off doing this through GLSL?
Posts: 1
Participants: 1