Hacker News new | past | comments | ask | show | jobs | submit login
Cool water vapor effect in HTML5 Canvas (raizin-japan.com)
113 points by w00kie on June 28, 2013 | hide | past | web | favorite | 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!

I think it looks even cooler because of its simplicity.

Hah! the funny part is that at first glance, I had almost convinced myself that they had implemented a full fluid dynamics system because I was like, "it's even causing a little localized vortex!" :P

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)

Yeah HTML 5 is such a resource hog! Brign back flash :p

The biggest advantage of flash is that it is easy to disable and you don't loose out on disabling it.

Yes, I'm prepared to miss they days of flash.

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...

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...

What browser?

Ahhh, good question. Safari.

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.

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

Doesn't work with my resolution of 1280x1920 px. ;)

Why are you so happy about it not working?

I am not happy about it, but should I be grumpy?

No one suggested that.

It was implied

Cpu: 42%

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact