Lens Flare!

Discussion and feedback on Construct 2

Post » Fri Oct 31, 2014 3:22 am

For any one interested, I've made an experimentation on recreating a dynamic Lens Flare effect. Ideally some genius could do it with a behavior or something, but here it is, in my own layman way :D

Here is an online preview: http://www.eli0s.com/Tests/LensFlare/

And here is the capx file:
LensFlare.capx

Please feel free to build upon and improve this example! I'll be happy to see any suggestions and ideas! Just don't turn your game into a JJ Abrams movie ;)

note: with 32 lens objects I get 3% cpu usage (on the debugger running in Chrome). I feel like it's fare enough but I have no idea hoe this scales on non desktop devices.

note2: @Ashley , I don't know if it's my system's problem but the same capx gives me an assertion error with version 186. Is this a bug perhaps? Also, I've noticed in the last few versions of C2 that the Tilled Background object produces an artifact, at least on the preview mode. It's hard for me to explain in English, please have a look on the TB object in this capx, notice that I've intentionally left a 1 px line empty on the bottom of the image. Otherwise, when the height of the object is 256 px (the default image's height) there is a 1 px bleed on the top.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Fri Oct 31, 2014 3:55 am

That looks fantastic! Really, just a great effect and works wonderfully!
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Fri Oct 31, 2014 4:29 am

Beautiful work, if its amazingly lite on CPU resources thats a massive advantage for implementation in mobile games!
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Fri Oct 31, 2014 5:06 am

That does look really nice. Great work, Eli0s!
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Fri Oct 31, 2014 5:55 am

Looks and works great
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Fri Oct 31, 2014 6:06 am

Wow! That's absolutely beautiful! Thanks for sharing eli0s! Hehe I am sure many of us will purposely try to find a way we can implement it into our game :mrgreen:
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Fri Oct 31, 2014 1:10 pm

I had a dynamic lens flare before it was cool :)

open this image in new tab to see the whole
Image

@eli0s online preview seems not working at the moment... cannot compare Your flare
B
40
S
14
G
6
Posts: 154
Reputation: 5,521

Post » Fri Oct 31, 2014 1:28 pm

@C-7 ,
@Silverforce ,
@DatapawWolf ,
@volkiller730 ,
@rekjl ,

Thanks guys! :)

By the way, does anybody know a better way to use one Sprite in order to mask in an other, but in the manner that destination out works? What I mean is, when we have a large sprite and on top of that an other smaller sprite with the blend mode set Destination out, the small sprite cut's a whole into the Sprite bellow. For instance, we only need a small gradient circle with a solid center that fades in opacity towards the edge, and with that we can cut a whole in to a solid colored layer (the way lighting effects in a dark environments is done in the ghost shooter tutorial).

Image
The small circular sprite cuts a whole in to the solid black layer, enabling the content below to be shown.

However, the opposite doesn't happen. If we wish to use the same small Sprite in order to show just the part that it covers (in respect with it's opacity), we realize that outside the physical borders of the Sprite, both Destination In and aTop blending modes fail: The pixel information of the sprite bellow (or of the colored layer) is been displayed outside of the small Sprite's edges.

Image
The same circular Sprite does reveal the black layer bellow, taking in to account it's opacity values. However, the effect breaks outside the Sprite's physical borders and the black layer is visible.

In my Lens Flare example, the Sprite named "HotSpot" is used to show the lens dirt spots. In order to do that, I had to stretch it into a great size, something that is not very practical, has limitations and either need a huge Sprite if details are needed, or renders blurred results when stretched.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Fri Oct 31, 2014 1:33 pm

@rozpustelnik , nice! I hadn't seen any other lens flare examples before, this is great!

I think that you can't see the online example because you live in Poland. For some ^&%*$ reason my domain is been blocked in some countries. You can always try the capx however!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Fri Oct 31, 2014 1:47 pm

@eli0s Will try the capx as soon as I get home. I'm very curious how You managed the lens flare mechanics/code.
B
40
S
14
G
6
Posts: 154
Reputation: 5,521

Next

Return to Construct 2 General

Who is online

Users browsing this forum: olympo and 10 guests