Godot Version
4.3
Question
I’m trying to have an outline shader that only highlights certain objects. Aiming for a stylistic thing what older animation did where only moving stuff had a border and everything else was painted background. That is why doing the advanced post processing quad child of camera isn’t what I want. I checked the shaders site and there are material shaders that almost but didn’t quite work (see bottom of post). So I’m currently messing with viewports. I think I get why it doesn’t work, but don’t know the solution.
Current setup is this. Everything is in the viewport, things that want to be outlined are on cull layer 1 and 2. The Outline camera sees only cull layer 2. The textureRect is a viewport texture with a canvasItem outline shader.
This almost works but the outlines render over everything. Which makes sense, it’s being rendered after the viewport. So the solution I would think is have an exact copy of everything so that the outer camera can see and cull that. Problem is that it would be an organizational mess in an actual level, so I feel like there’s a better way.
Is there a way to do this cleanly and well organized? Alernatively, does anyone have a material shader that can do an outline on lowpoly meshes? The one I found Pixel Perfect outline Shader - Godot Shaders needs smooth normals which I don’t want on some of my meshes.