Cool water vapor effect in HTML5 Canvas(raizin-japan.com)
raizin-japan.com
Cool water vapor effect in HTML5 Canvas
http://raizin-japan.com/cool/
34 comments
It's 'just' a couple of scrolling images for the vertical and horizontal vapour, and a rotating image for the swirl where they meet. Very effective indeed. I'm impressed.
Indeed, I've played with it a bit to demonstrate: http://s3.amazonaws.com/clouds-reverse-engineered/index.html
Gah! Now I understand how it works, it does not look nearly as cool as it did before!
Gah! It does look cooler in a geeky way now. Nice!
Agreed, when you know what to look you can see the components, but at first glance it looks very believable.
Too bad even such a simple visual hack was enough to get the fans spinning on my mac air (circa 2011)
Too bad even such a simple visual hack was enough to get the fans spinning on my mac air (circa 2011)
It's because they don't understand how to properly use canvas, as was pointed out here: https://news.ycombinator.com/item?id=5957101
Oh yes. My CPU-Meter jumped from 3-7% to 35 - 55% while the page was open and dropped back to the previous-level on closing the tab.
Too bad, as it really is a cool effect, done with relatively simple assets...
Too bad, as it really is a cool effect, done with relatively simple assets...
Interesting. Neither Chrome nor IE or Firefox on Win 8 go above 3 % CPU utilisation here
Same here. Firefox + Win8 and it stays at 2.5% to 3%.
Safari on 10.8.4 and the CPU usage is only 2-3% higher with that tab open. (iMac/2012)
On a Macbook Air 2012 running Mavericks it sits at 1-2% CPU usage...
I like the end result, but i'm not sure why they decided to use 14 canvas tags when 1 would have worked just as well.
It seems wasteful, canvas was designed specifically to allow drawing and manipulating multiple images on a single surface, these guys are using canvas as if it were a div with a background image.
It seems wasteful, canvas was designed specifically to allow drawing and manipulating multiple images on a single surface, these guys are using canvas as if it were a div with a background image.
Maybe they found it performed better, like Adrian Holovaty found for soundslide: http://www.holovaty.com/writing/in-defense-of-canvas/ (see "stacking canvases")
Stacking canvases makes sense when you have ones that either only need to be built on startup or change infrequently. If everything in your animation is moving (like this one) then there’s no performance benefit.
Are you sure about that? Would be interesting to see a performance comparison.
…which makes me wonder if CSS animation on stacked divs would be more efficient too?
...or an animated GIF
If you layer several animations with varying and carefully selected run times over each other, the result never exactly repeats itself. Good luck recreating that with one GIF animation :D
An animated GIF would weigh a lot more.
Goes to show, you don't always need to do things the hard/proper/science way to make something like this convincing. Smoke and mirrors ftw. (although this particular set of smoke and mirrors could probably do with a little optimising. I'ts a good effect nonetheless)
Took about 2 minutes before the animation actually started, but clever effect.
This is much like how particle systems in games work
Cpu: 42%