Arvtesh / UnityFx.Outline

Screen-space outlines for Unity3d.
MIT License
1.28k stars 90 forks source link

Merge objects in the same layer #12

Closed Noxalus closed 4 years ago

Noxalus commented 4 years ago

Hello!

I just discovered your work, and it seems pretty neat!

I would like to use this outline effect for my personal project to draw outline around multiple floor tiles as post process, and it seems pretty suitable for this purpose.

But, as each tile is a specific GameObject, I would like to avoid outlines between two tiles side by side and only have the outline around them.

Here is an example of what I would like with 2 cubes:

When they are not side by side: image

When they are side by side: image

Is there an easy way to do that?

Thanks in advance for your answer! 😄

Arvtesh commented 4 years ago

Hello @Noxalus, nice to meet you! Try making all the cubes children of another game object, and then only draw outlines for the parent game object.

Noxalus commented 4 years ago

Wow, very nice! 👍

Thank you so much for your help and for this tool, and sorry for the dumb question :/

Noxalus commented 4 years ago

I re-open this issue quickly as it's related, but if I have my parent game object in the outline effect, it will outline the children merging them properly. But if I add a new child to this parent, it won't be taken into account 😞

Do you know why? Do I have to call a method to refresh the outline effect? 🤔

Arvtesh commented 4 years ago

If you're using OutlineBehaviour, there is Update renderers flag you can set in inspector.

Avol commented 4 years ago

Would be cool to have a feature to merge all outlines into single one without having to layer with parent game object. I have an issue where many game objects move around and storing them under same parent would cause many transform problems. For example all objects within one OutlineLayer coul merge as if it were under 1 parent gameobject?

Arvtesh commented 4 years ago

Seems an easy enhancement, I'm scheduling this for next release.

Avol commented 4 years ago

Awesome! This will save a lot of time and performance issues for my project!