Snowflakes

Community Forums/Showcase/Snowflakes

Krischan(Posted 2011) [#1]
Again, a useless but very nice piece of code for the holidays, let it snow... The image is an old wallpaper from www.bunnybua.com, a little bit redesigned by me for this demo. The MP3 Track can be freely downloaded from Jamendo here (or use your own track). The code uses a background image and a matching matte in greyscale for the snow.

Merry christmas to you all!





Images needed:

image.jpg


matte.png


Last edited 2011


BlitzSupport(Posted 2011) [#2]
Very nice -- I've always liked this effect since way back in the 8-bit days!


Krischan(Posted 2011) [#3]
James - I updated the codebox a few minutes ago - the flakes are now more fluffy, looks much better than just single pixels.


BlitzSupport(Posted 2011) [#4]
Ah, yes, that's nicer.


Steve Elliott(Posted 2011) [#5]
Neat :D


col(Posted 2011) [#6]
Hehe. Very festive indeed. Very nice :)


Krischan(Posted 2011) [#7]
I converted this to Blitzmax (and redesigned the code a little bit, added a sinus movement and the falling flakes are images now). It works so far but there is one problem. On my system, the FPS drops and drops and I don't know why. Any idea how to speed this up or improve it?

Full Demo with source, EXE and media: Download ZIP [5MB]






BlitzSupport(Posted 2011) [#8]
How long does it take before it drops? Seems fine here after a few minutes in release mode (even if debug mode is very slow)...


Krischan(Posted 2011) [#9]
The debug mode is indeed very slow. In normal mode it starts at 70-80 FPS (with zero flakes) and drops to 50-60 with 20000 flakes, the maximum. After a minute it drops to 40-30, still with 20000 flakes. First I tried to simulate the falling snowflake code from my B3D version but I couldn't find out how to write the flake pixels to a transparent pixmap over the background image in the loop (impossible?), so I went for the current solution with a separate 12x3 pixel snowflake variation image and DrawSubImageRect.

Strange - in the B3D version I can go up to 50.000 flakes before it drows below 60FPS.

Last edited 2011


grindalf(Posted 2011) [#10]
It just shows how B3D is superior :P


markcw(Posted 2011) [#11]
Nice. Wait a second, where's the Monkey version? :P

Last edited 2011


John G(Posted 2011) [#12]
Very nice snow sticking effect.


Krischan(Posted 2012) [#13]
Bump. It's christmas time again! This time with precompiled executables in B3D and BMAX + source + media in one ZIP file.

Download: letitsnow.zip (3.5MB)



Last edited 2012


CyBeRGoth(Posted 2012) [#14]
Great stuff I am now fully in the Christmas spirit! hehe


psychicbottle(Posted 2012) [#15]
haha, very nice here. :p


shinkiro1(Posted 2012) [#16]
Nice one.


Krischan(Posted 2012) [#17]
Well I've been bored and so I updated the demo a little bit, optimized the source and used maxgui this time. Now includes a happy new year firework, press Space to switch between the two modes, in firework mode press LMB for a new rocket and RMB to reset the rockets.

Merry christmas and a happy new year to you all!

Download Demo: letitsnow2_demo.zip (8.2MB)
Download Source: letitsnow2_source.zip (1.8MB)
(I didn't include the music in the source to save filespace, you can download the tracks from the links in the source comment and convert them to OGG using Audacity for example and put them in the music/ folder or use your own)

Screenshots (looks even better in action):


Here the full source:



Dabhand(Posted 2012) [#18]
Bah Humb.... Ohhhhh, nice!!! :)

Dabz


JBR(Posted 2012) [#19]
Really nice and peaceful.
Jim


JonnyEnglish(Posted 2012) [#20]
Wow..cool!


Steve Elliott(Posted 2012) [#21]
Yes, a stressful day...then I put this on lol...very soothing.