Generate 2D penetrating light rays

Hello all,

Apologies if I have posted in the wrong section of the forums.

I am looking at a way of generating some animated light rays in 2D to add to a menu scene. I was wondering if anyone has done something similar and how they achieved it? I have tried adding a full screen image over the top of my scene and playing with the blending via setting the sprite to use a particle shader (to get the blending mode) then animating the sprite position left to right and at random intervals changing the direction. The effect looked OK at best but really looked pretty rubbish.

I have my default menu background:

And then a light ray image (found via Google)

and when combined I wanted something like this (although might be a little too hard in this Photoshop version)

Or something a little more subtle:

But like I say, I’d really like to animate it as if the trees about the scene were gentle moving in the breeze. Any suggestions welcome on how to do this in the easiest way (that is still visually appealing), I don’t want to go too heavy just to do this as it;'s only a menu scene and doesn’t really add anything to the project :slight_smile:

Kind Regards
Gavin

Break the light rays image up into several overlapping images, left right, center, etc - overlay it onto your BG and animate the opacity of each light ray layer, over time. That’s a pretty simple solution.
You can probably get better results by having individual light ray layers, and individual subtle moving dust particle layers also animated over time.

1 Like

Maybe multiple color by 2nd scrolled texture color. Raw example:

2183126–144685–Beams mat.unitypackage (464 KB)

1 Like

Thanks Dwight, I will have a look at mocking something up and if it works, I can find an artist to do some decent art ( not my strong point at all :smile:)

Thanks @mouurusai I shall take a look at this now

Hey thanks for this. It works really well when I drop it into my test scene. I Just need darken my background texture and little and have a play but it looks pretty great with “fireflies” drifting slowly around too.

1 Like

Nice. Upload a gif if you have a chance. Would like to see the results.
Glad I could help.

Been trying, but would seem the smallest I can get the gif is 3.5mb and the server wont allow an upload

*edit - lets try a 3rd party GIF site:

Looks good. It works well with the perspective you’ve chosen.
Nice work.

1 Like

Thanks, one screen one, 5 more to go :smile:

Did you made that Artwork yourself? I would love to get my hands on these Assets to try them out on a Shader set I am working on.

Do you mean the tiki background image or the images used for the light ray effect ?

The Tiki background without lightning, I would like to try something out if you don’t mind :slight_smile:

It is custom artwork I had made for my project, drop me a private message and I will sort you a copy of the image to test on :slight_smile:

I went back a visited this again today and changed some code in the shader and the textures used to get a different effect. Think I prefer this over the first but will continue to play :slight_smile: