Lo-res Water Demo
-
I stumbled across this article:
...and I thought I would have a go at implementing a water ripple effect in Fuze.
So this is the result! The uploadImage() function made the whole thing very easy to implement. The performance wasnβt the best, though, so I had to scale down the image a lot. I currently get about 10 fps for an image with size 42 * 24 pixels. I then scale up the image to full screen.
Actually, the uploadImage function is pretty fast, the bottleneck is the amount of calculations needed to calculate averages for each pixel.
I originally had the code below 50 lines, but now itβs slightly bigger since I added in a lot of explanatory comments. Control the ripples with the touch screen!
ID:
4F863MND5C
-
Really Nice! Keep up the good work.
-
hmm I wonder if this can be converted into height mapping for terrain... wonderful job I love the effect!
-
@JMM161437 said in Lo-res Water Demo:
hmm I wonder if this can be converted into height mapping for terrain... wonderful job I love the effect!
Thanks! Feel free to use the code if you want to!
-
Thanks @vinicity!
-
This demo is too good for me to ignore the possibility I saw of making it high resolution using blend mode arithmetic to get the GPU to do the heavy lifting. I sort of had it working but due to the low bits of precision and GPU rounding I couldn't get the waves to damp. The ripples would just propagate and reflect until the screen was filled with static noise. However, I just now discovered a way to damp the waves with the threshold render effect.
So now I have the demo working at 60fps at the full 720p resolution. The calculations aren't perfect because the pixels (probably) have only 8 bits per colour channel so the ripples don't get big enough to fill the screen and bounce off the edge. Even so, the result was too mind blowing to not share it.
High-res water Demo
ID:R4663MND9L
(sorry @vinicity for taking your demo and your thread)
-
Absolutely Stunning!
-