[ SHADER ] something similar to God Rays?

Get help using Construct 2

Post » Thu Oct 31, 2013 8:29 pm

Hi everyone, and thanks for reading this.

I'm porting a game from an other tool to C2.
I love it, and everything shapes very well.

The only thing I'm stuck with is a shader I had on my title screen.
Some god rays were coming from the sun in the background, and I'm looking for a trick in C2 to do this.

YOUTUBE VIDEO
http://www.youtube.com/watch?v=nus4tmILY4s&feature=youtu.be



I don't NEED it, but it looked quite cool and I'd like to get something similar (even faked) in C2.

Any idea? :)Aurel2013-10-31 20:34:52
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Thu Oct 31, 2013 9:00 pm

Here's some (probably bad) advice:
why not a pre-animated, semi-opaque sprite (or a couple, across different levels) with blurred edges and blend mode set to something like additive?
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Thu Oct 31, 2013 9:34 pm

Thanks a lot for your answer, but that would be pretty hardcore! ^^!
It would be faster to "bake" it into the character animation, and trigger the god rays when the sun colide with it. Maybe I'll do this, as the textures should be unloaded when skipping to the next layout, it should do the trick. But it's going to be super heavy on GPU... =__=

I'm using a lot of C2 Web GL shaders, and most of them are really good. I tried to mix webGL shaders / blendings modes, but I can't get something like this.

Again, I don't absolutely need it, but when I look at the plug in section of this forum, I would be surprised if nobody here already tried to mimic an effect like this one ;)Aurel2013-10-31 23:26:41
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Fri Nov 01, 2013 5:31 am

You could come close with shadow casting and some shaders, but eh..not really the same. I think you'll need a new one.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Fri Nov 01, 2013 10:29 am

Hey, actually Shadow casting + radial blur could be close enough!
I just need to find a way to apply it only on foreground sprites, with a mask or something.

I'll try this, thanks for the idea! :)

Bonus: as the source code for this shader is available, is porting a non C2 shader to a C2 web gl shader difficult ? Could a beginner like me give it a try or do you need to know how to code for real?
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dop2000, Lancifer, richcoz81 and 26 guests