Outlined Invisible Object
Asked Answered
S

2

0

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 answered 9/10, 2023 at 19:55 Comment(0)
F
0

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

Forecourt answered 9/10, 2023 at 21:39 Comment(0)
T
0

Stoppage

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.

Trochanter answered 9/10, 2023 at 22:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.