Blend MOdes

Discussion and feedback on Construct 2

Post » Wed Nov 21, 2012 9:36 am

A very simple question! Do blend modes set on object works on objects on different layers. Eg will source out work on an object that is one layer below the current acting objects layer?

Cheers.
B
7
S
1
G
2
Posts: 10
Reputation: 1,802

Post » Wed Nov 21, 2012 3:00 pm

It depends on if the layer is drawing off-screen or not. By default everything just draws directly to the screen. This means all effects and blend modes work as if everything was on the same layer (so you can blend across layers).

However if the layer has 'Force own texture' enabled, OR it uses layer effects or a layer blend mode, OR its opacity is not 100, the layer will draw to its own off-screen surface. This means objects on the layer can't blend with any other objects from other layers. However as long as you don't use any of those things, objects should blend between layers just fine.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Nov 23, 2012 2:46 am

Thanks Ashley That has helped alot. But I'm not sure what you mean by on-screen off-screen in this context. You don't mean literally outside the project window do you? If there is a link to what this means ill just follow it. Cheers
B
7
S
1
G
2
Posts: 10
Reputation: 1,802

Post » Fri Nov 23, 2012 2:47 am

*off screen surface
B
7
S
1
G
2
Posts: 10
Reputation: 1,802

Post » Fri Feb 22, 2013 8:55 am

Hi Jubalicious,

I had some similar questions about layers and blend modes so did some research (and found this post as well). When Ashley says that it's rendered to its own off-screen surface, he means that memory is reserved to hold another full screen image. The off-screen surface can't be seen, and it's not hiding off the edge of the screen or anything. It's used as a scratchpad and you will never actually see what's drawn to that memory, but instead, after we've drawn to the off-screen surface, then we draw the image from the off-screen surface to the screen.

If you're interested in the technical details, you can check the Javascript file "layout.js" functions "Layer.prototype.draw" and "Layer.prototype.drawGL". Draw creates a new HTML5 Canvas in memory (but it's never added to the webpage), and DrawGL makes a WebGL Texture object.
B
6
Posts: 26
Reputation: 577


Return to Construct 2 General

Who is online

Users browsing this forum: saiyadjin and 15 guests