Download

Can someone tell me the proper way to handle material effects on objects?

Hi, I’m working on a RTS, right now I’ve made a material outline so when i click on something it gets outlined, it’s just a normal material applied on a copy of the mesh stacked on top of each other. That’s definitly something i want to change but the main question is, why doesn’t exist any tutorial for materials effects like outline etc…? I just see post processing videos, is there something i should consider instead of working with raw materials on meshes? I avoided those because to me it sounds more like a global effect in the scene not something you want to apply to a specific object.
Thanks.

Maybe. The issue with mesh outlines is every mesh with an outline requires additional draw calls. Depending on how you have set up the outline it also might mean increased animation cost, overdraw, or memory consumption.

Post process effects can be applied locally in a regular translucent material applied to a bounding mesh. Tom Looman did a brief rundown of this on his blog a long time ago; example implementation here.

I’m confused, the title of the blog says “Without post processing”.
Btw can post processing effects be applied to a specific mesh/Actor? I always have seen examples by distance indiscriminately.

It is a translucent material that behaves like a post process. There are probably some effects you can’t achieve with it, but I only use it for outlines and for that purpose it works.

You would use the stencil buffer for this.