Cover Screen with Snowing Effect in Libgdx

| | August 8, 2015

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect?

The methods i can think off the bat are:

-Using LibGDX’s Particle System:
But it seems like it will be overkill for some reason, i need the snow all over the screen and i have the idea that particle system is only optimized for ephemeral occasional particles (correct me if im wrong)

-Draw a giant animation that fills the entire screen
Well, it also seems quite overkill… and it sounds hackish and dirty.

Id like a smooth effect, like a snowstorm, I cant think of any optimal method nor I have great experience in particles to be honest. So, any ideas?

P.S: The game is mainly for android, which is why Im so worried about an optimal solution

2 Responses to “Cover Screen with Snowing Effect in Libgdx”

  1. Im using libgdx particle system for a snow effect here’s the draft file
    ,this will need some tuning but a good start.
    In this effect the png get some light blue tint.

    You can simply import it

    ParticleEffect snowEffect = new ParticleEffect();<br>
    snowEffect.load(files.internal("snow_effect"), [files.internal("particle.png")][2]);<br>
    snowEffect.start(); 
    

    have to call the start method

    and in the render loop you should call
    snowEffect.draw(batch,deltaTime);
    this will updating then drawing the effect,
    there’s a simple draw without the delta time , in that case u have to call the effect.update(deltaTime) before it.

    ps:you need to position it to the top of the screen and match the width

  2. deadpixelsociety on November 30, -0001 @ 12:00 AM

    The particle system solution is likely the one you want as creating and maintaining 100+ sprites with varying positions and gravity is exactly what a particle system does. Only it will handle object re-use for you automatically which will help make it as efficient as possible.

    Just create a line emitter that covers the entire width of your viewport. Place it slightly above the top of the camera viewport so that spawned snowflakes appear to drift into the frame. Give the particles a downward gravity and give them some horizontal jitter to simulate a drifting movement. Give each snowflake a random scale to simulate some sense of depth. You could even base the strength of gravity based on that scale to give a proper parallax. Maybe even lower the opacity of each particle based on how low the scale is to increase the sense of depth?

Leave a Reply