How do I Fade one side of an object?

Get help using Construct 2

Post » Thu Apr 23, 2015 1:11 pm

erm i just got answered my question about something similar
viewtopic.php?t=129382

if you created your map in a way where you have your bases that cannot be walked past in 1 layer and an extra layer for the pillars and such, you can have a constant sprite overlap your character and do a source out on the pillar layer so the circle overlapping your character would "erase" the pillars temporarily

i personally think its a good idea to separate your maps also since you can create map interactivity
B
6
S
1
G
1
Posts: 5
Reputation: 385

Post » Sat Apr 25, 2015 4:09 pm

Thats a good idea. Gotta love Containers! I think I'll end up with two separate sprites anyway. I'll have the Base for solid collisions, and the decoration, which detects collisions for z ordering and fade.

I was a disappointed that nobody pointed me towards any documentation or tutorials on how Effects work in C2. I found plenty of tutorials online about glsl and other shader languages, but I really had to work for it and guess to figure out that GLSL was the language in question, or that the .fx files are fragment shaders, or that when I get the front color it is considered to be in a premultiplied state. I was able to find literally no documentation at all on how C2 handles shaders.
Anyway, here is what I got:
viewtopic.php?f=184&t=129562

Anyway, I built the shader I wanted, and threw in X axis support for lulz.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Sat Apr 25, 2015 5:12 pm

@bladedpenguin

Here's a list of variables that C2 provides for use in the shaders. To use them you still need to declare them at the top of your fx file.

viewtopic.php?f=184&t=115900&p=901905&hilit=effects#p901905

Most third party shaders are made by copying what existing shaders do. There was a question about variable qualifiers which may also be useful:
viewtopic.php?f=184&t=115900&p=901905&hilit=effects#p901905

Thirdly as a testing ground I've seen this online tool used to make shaders quicker:
www.shadertoy.com
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sat Apr 25, 2015 9:26 pm

Awesome! I found your list of C2 variables when I went to go post my WIP to the effects board. I guess I should spend more time poking about the site and less time googling. oh well.

The tester I found was http://shdr.bkcore.com/ , but ShaderToy seems more useful, and i think I'll use it [s]if I ever[/s] next time I want a shader no one else wants to make.

To figure it out, I pretty much did as you said and took apart the default shaders and reworked the math.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Sat Apr 25, 2015 10:15 pm

@bladedpenguin
On the note of searching, you can use google to search only the scirra website by adding the following to your google search.
Code: Select all
site:http://www.scirra.com


It has certain advantages over the forum's search.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Previous

Return to How do I....?

Who is online

Users browsing this forum: rayolf and 17 guests