samplerBack and layers

For developers using the Construct 2 Javascript SDK

Post » Mon Jan 20, 2014 10:39 pm

I'm writing a shader, and I was wondering if there is anyway to only check a specific layer when sampling the background.

For example when I use:

lowp vec4 back = texture2D(samplerBack, mix(destStart, destEnd, vTex));

if (back.a > 0.5)

is there anyway to exclude or specify a layer, or is it always the sum of every layer other than the current layer ? So in this instance back.a would only refer to the alpha of the layer under the current layer.
B
6
S
2
G
1
Posts: 39
Reputation: 1,303

Post » Tue Jan 21, 2014 1:29 pm

It's either the entire layout drawn so far (by default), or the current layer drawn so far only (if using its own texture). We can't force a separate texture per layer, it will murder the fill rate on low-end systems.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Wed Jan 22, 2014 10:48 pm

That makes sense, thank you Ashley
B
6
S
2
G
1
Posts: 39
Reputation: 1,303


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest