Much appreciated! I also experienced the random artifacts you were speaking of. Fixed it by setting minimum_dist to 0.9 rather than 1.0 in the worley function. For some reason your fix with the 3 color lines about min/log/multiply 50.0f didn't help. Maybe because i'm running GLES 2 compatibility? Anyway cheers, i love the effect! :)
Looks great. The caustic movement could be more wobbly, but the effect itself is very good. Maybe you could add a transition in the x or z axis , so you can make it look like the caustics are fading away to represent the the water getting deeper.
Yes it could be more wobbly! That's a great idea. I think this might be achievable by manipulating the Worley noise over time somehow, but I haven't figured that out. I also think it would be possible to fade the effect out based on some calculation with the distance to the camera. Thanks for the response!
For those curious about this, @arthigo was correct in that you can multiply two alternate-moving worley values to achieve a rudimentary wiggle / breathing effect, rather than just have the caustics move linearly like the vid (not that that was bad, could be cool for some environments). float worley1 = worley(world_position.x * scale + TIME * speed, 1.0f, 1.0f); float worley2 = worley(world_position.x * scale - TIME * speed, 1.0f, 1.0f); float color = texture(color_ramp, vec2(worley1 * worley2)).r; Above assumes you set a scale value (which I recommend making at least .05f). I also found changing the white value to slightly gray-white for the color gradient makes white spots less intense since things are overlapping a bit now. I also doubled that color value, so instead of multiplying color *= 50.0f; I'm doing *= 100.0f.
I'm confused as to why your shader overlays atop not only the background but the coral and other decorations when you only applied the material to your backdrop node. I'd like to achieve a similar effect but applied over every mesh in my scene (as though I were projecting the noise over the 3d space) but for me this just seems to apply flatly to just my terrain.
All the objects in my scene share the same material. I often use a single texture with a grid of colors as my albedo, and move the objects UV map to the color I want. I like to do this to keep the number of materials I use low.
This video is phenomenal. Thank you for explaining everything so thoroughly!
great video, enjoyed the visual/explanation of the math as to avoid magic numbers.
Much appreciated! I also experienced the random artifacts you were speaking of. Fixed it by setting minimum_dist to 0.9 rather than 1.0 in the worley function. For some reason your fix with the 3 color lines about min/log/multiply 50.0f didn't help. Maybe because i'm running GLES 2 compatibility?
Anyway cheers, i love the effect! :)
Looks great. The caustic movement could be more wobbly, but the effect itself is very good. Maybe you could add a transition in the x or z axis , so you can make it look like the caustics are fading away to represent the the water getting deeper.
Yes it could be more wobbly! That's a great idea. I think this might be achievable by manipulating the Worley noise over time somehow, but I haven't figured that out. I also think it would be possible to fade the effect out based on some calculation with the distance to the camera.
Thanks for the response!
@@cadoink Usually it's done by multiplying two noise textures moving in different directions at the same time
@@arthigo Thank you. I've got it somewhat working. I'll keep tweaking. If I get something cool I'll post a follow up! 😀
For those curious about this, @arthigo was correct in that you can multiply two alternate-moving worley values to achieve a rudimentary wiggle / breathing effect, rather than just have the caustics move linearly like the vid (not that that was bad, could be cool for some environments).
float worley1 = worley(world_position.x * scale + TIME * speed, 1.0f, 1.0f);
float worley2 = worley(world_position.x * scale - TIME * speed, 1.0f, 1.0f);
float color = texture(color_ramp, vec2(worley1 * worley2)).r;
Above assumes you set a scale value (which I recommend making at least .05f). I also found changing the white value to slightly gray-white for the color gradient makes white spots less intense since things are overlapping a bit now. I also doubled that color value, so instead of multiplying color *= 50.0f; I'm doing *= 100.0f.
Thank you
For 4.3: WORLD_MATRIX is now MODEL_MATRIX.
My caustics look horrible, I followed strictly though. A bit unsure what it could be.
I'm confused as to why your shader overlays atop not only the background but the coral and other decorations when you only applied the material to your backdrop node. I'd like to achieve a similar effect but applied over every mesh in my scene (as though I were projecting the noise over the 3d space) but for me this just seems to apply flatly to just my terrain.
All the objects in my scene share the same material. I often use a single texture with a grid of colors as my albedo, and move the objects UV map to the color I want. I like to do this to keep the number of materials I use low.