Erase blend

Post your own tutorials, guides and demos.

Post » Thu Sep 04, 2008 9:12 pm

From my understanding erase blend is meant to erase things on it's layer and show the things below right?

When I try to use it it just looks all garbled.

What am I doing wrong?
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Thu Sep 04, 2008 9:37 pm

On the layer with the erase object you need to check "Force own texture" under layer properties. That will keep it from erasing everything.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Sep 04, 2008 9:41 pm

nice one thanks!

EDIT: out of interest what does this do other than make erase work? (any side effects?)
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Thu Sep 04, 2008 10:01 pm

I think it screws arround with the other non-pixel shader effects on that layer. I know that regular Additive won't work anymore.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Sep 04, 2008 11:37 pm

Well, it's an efficiency thing. When a layer has no effects or anything, it just draws directly to the screen, because it's just another bunch of objects. 'Force own texture' makes it draw to a separate, offscreen surface, and once the layer is drawn there, the whole surface is pasted on top of the screen. This is slightly slower since it has to copy the surface to the screen, but most video cards can do this sort of thing a few thousand times a second without breaking in to a sweat.

When the layer is drawing directly to the screen, erase doesn't work because you can't cut a hole in the screen - there's nothing underneath. When the layer is drawing to its own surface, it's cutting out an area of transparency in the surface, so when it's pasted to the screen, there's a hole in the layer and whatever was beneath shows through.

If you change the layer opacity, filter, or add layer effects, it has to draw the layer to its own surface to process the effects anyway. So you only need 'Force own texture' if you want to process an erase or mask effect, and the layer has no effects.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest