Excluding layer effects for certain objects on layers

So, i’m using the outline 2d effect on the base layer, however, i’m also applying outlines at a different thickness value on certain objects on the layer.
However the outlines from both the layer and objects overlap, causing the outlines to appear thicker then they’re supposed to.

The base layer outline thickness is 0.14
The level object outline is 0.3
I tried to give particle effects -0.14, think it would subtract from the base layer giving it a thickness of 0, but it didn’t…

What should I do?

I believe the thickness is logarithmic, not linear, so you will have to experiment with increments to get close to the thickness you want.

If you mean how do you outright exclude one object from layer effects on its layer? Unfortunately, you can’t.

For that your options are either don’t use layer effects (having to use object effects on each object you want it on.) or you move the objects to a different layer. There isn’t a way to exclude objects on a specific layer from that layer’s effects because thats not how they work in PixiJS.

Put these objects on different layeR?

or apply effects to a group of objects on the layer, but not to all objects on the layer.

I don’t know if apply effects to object groups is possible. I’ve tried it, and it didn’t work, and some guys on the discord group said it’s not possible.

You need to manually add effect to each object in a group
But you can disable it via event for any/all object from that group

As said by Zero, you add desired effect to each objects of the group created before.
Only these objects would have the effect on the layer.

A+
Xierra

The effects are not “combining”. What’s happening is the object gets an outline of 0.3 first, then that new image (with outline included) is processed on the layer and given another outline. Negative outline, if it does anything, would put the outline inside the boundaries of the sprite, but even if it did “subtract” then it still wouldn’t work because you’re dealing with two separate parts of the image processing.

Layer effects are efficient because they apply to the entire layer in “post”. You can clearly see this by allowing two objects to overlap with a layer outline - the part that overlaps will NOT have an outline. The composite image is outlined as an entire thing, not the individual objects being rendered. On the other hand, giving those objects their own outline effect will allow them to keep their full outline while overlapping (at the cost of more processing)

2 Likes

processing, huh? Yeah noticed that ever since I added the outlines, the game’s been chugging a bit. How can I reduce the lag?

By using layer effects as much as possible, or by including the outline as part of the sprite graphics directly.