Hey, fresh face here. I was trying to implement an effect where an object is just rendered as an outline, with the actual object being transparent. I can get a decent looking outlined object and a weird mass of unshaded white, but can't get it so the outline itself can be seen through. I've found info about it for Unreal and Unity, but have no clue how I'd translate those systems into Godot.
Stoppage I was trying to implement an effect where an object is just rendered as an outline, with the actual object being transparent.
Something similar, maybe this
I don't have a godot example I can give you, but I can see what that Unity shader is doing.
It's a multipass shader. That means it is running twice on every fragment.
Godot does not have multipass shaders, but it does allow you to put multiple materials on one mesh.
In the Unity shader, all it is doing is drawing "something is here" to the stencil buffer (for this purpose you can think of it like a screen-wide texture)
The second pass is checking the stencil buffer and asking "is something already here?" If the stencil buffer says yes, then it doesn't draw. This way it ONLY draws the very edges, giving you an outline.
Maybe something like this can be done with multiple materials? I dont actually know for sure. Hopefully someone else can help you out more than me.
© 2022 - 2024 — McMap. All rights reserved.