Corona / Sun Bloom

Post your own tutorials, guides and demos.

Post » Wed Feb 11, 2009 6:12 am

One cool feature I've noticed in modern indie games is that in outdoor scenes they like to have a sun that follows the player around, but when the sun approaches the edge you can see the beams from the sun over the top of everything...but once the centre of the sun has gone behind a solid, the sun becomes less bright and stops 'blooming'.

The way to do this (i think) is to have two objects, one which is behind everything (so the sun), and one that is in front of everything (the bloom). You then make them have the same position, and when the centre of the bloom is overlapping a solid you make it fade out, and when its not, fade back in.

I used additive so no pixel shaders are required :)

Heres a screenshot:
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Wed Feb 11, 2009 7:54 am

hah that's cool man.
but when the sun is going behind a solid it's fadeing a bit to fast, should be more subtle
i think now it's like an "instant action" and not like "more behind - less brighter"
well just a thought....but still excellent example :)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Wed Feb 11, 2009 8:12 am

I was trying to figure out how you made the sun follow the mouse without any events and "discovered" - Mouse Behavior! The sun effect is really convincing, can't believe how much it brightens up the scene. Very cool when the bloom peeks through the hollow sections of the sprite defined as sold - kudos to Construct collision detection. And nice use of timedelta. So much to learn from a single event... Thanks!
B
2
S
1
G
3
Posts: 39
Reputation: 1,078

Post » Wed Feb 11, 2009 11:17 am

Wohoho man! That's so sweet!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Feb 11, 2009 12:38 pm

That......is really cool. I must remember to use that additive blend!
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Wed Feb 11, 2009 1:26 pm

Damn that's nice.. and so simple! I could see how it was done without looking at the source. That'll come in handy for sure!
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Wed Feb 11, 2009 4:32 pm

Clever use of additive :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Feb 11, 2009 9:54 pm

I really like the smoke effect.
B
2
S
1
G
5
Posts: 79
Reputation: 1,558

Post » Thu Feb 12, 2009 3:36 am

Nice effect man.

For some reason it doesn't get brighter again though when it's not touching anything... I have to restart it each time.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Feb 12, 2009 3:57 am

[quote="SoldjahBoy":2pd97m7h]Nice effect man.

For some reason it doesn't get brighter again though when it's not touching anything... I have to restart it each time.

~Sol[/quote:2pd97m7h]

I've got the same problem. Replacing the "Else" condition with an inverted version of the first event worked though. Nice effect when it's working. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest