Tilemap shader?

Discussion and feedback on Construct 2

Post » Sun Apr 26, 2015 11:19 pm

Just a thought.
Would it be possible to do a colorizer effect that can do different colors to individual tiles?
Something like set color of this x, this y to that color.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Mon Apr 27, 2015 1:16 am

The easiest way to do this is to create a new layer containing the color areas, then apply a modified version of the effect to function as a "mask" shader (it uses the layer texture to modify the background). It's quite easy to do.

Just for curiosity, what's your use case?
Scirra Employee
B
153
S
53
G
17
Posts: 710
Reputation: 17,825

Post » Mon Apr 27, 2015 1:40 am

Variation for tilemaps.
Change this grass tile yellow, that house blue, etc.
Only problem with masks is they bleed to layers below.
Something that changes the hue, not one that makes it all the same color.

Instead of x,y more like a tile at x,y.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Mon Apr 27, 2015 2:47 am

There's a way to avoid the bleed. Put your tilemap on a layer, place another tilemap over it with the color masks and apply the effect to it. Then enable "Force Own Texture" to the layer.

Here's an example.
Scirra Employee
B
153
S
53
G
17
Posts: 710
Reputation: 17,825

Post » Mon Apr 27, 2015 2:57 am

Thanks, I'll do some experimentation with that.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Mon Apr 27, 2015 3:30 am

With the way tilemaps work you could have endless tiles of different colors instead of using an effect. Effects always end up being too process-intensive anyway so even if you could have different tiles with different colors, when your game was complete you'd have a lot of trouble optimizing it.
B
124
S
43
G
41
Posts: 849
Reputation: 28,235


Return to Construct 2 General

Who is online

Users browsing this forum: EwiZad, marcinkowski and 15 guests