Editor Mesh outline tool

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vonflyhighace2
:warning: Old Version Published before Godot 3 was released.

I notice that there is a create outline tool for mesh instances nodes. Is there a way to access it through scripting during runtime? if not is there a way to invert the normal on a mesh because that’s really all the editor tool does is create a copy of the mesh and invert the normals on it.

Wow, although I understand how it works, I would have expected this to be made with a material/shader. Making a copy of every single mesh in a game sounds impractical :confused:

Which tool are you talking about?

Zylann | 2016-10-15 10:10

Yea, using a shader would be ideal but I haven’t gotten around shader programming yet so the next best thing is to cheat. Although for my use only one object would ever have an outline made at a time and my game being a turn base style game helps a lot with management of such an effect. Is the current shader model in godot allow for complex shaders like the highlight shader?

vonflyhighace2 | 2016-10-15 17:41

To implement the technique you described (which is the cheapest) I don’t think shaders on their own can do that. It depends on the engine. For example, Unity has a material system in which you can specify passes in a custom shader language, so you can actually tell Unity to draw twice a model with a single shader file, and when in the drawing process.
Thanks to this you can implement basic fur or polygon-based outline by just assigning a material.
In Godot, shaders don’t go beyond being shaders. They cannot create geometry or tell Godot to draw more. That’s why it forces you to clone MeshInstances if you want that.
In the future this could change though, for tessellation or newer things.

Zylann | 2016-10-15 18:23

You can use my Wireframe Tool plugin. It works in editor but you can delete tool keyword and call functions from the game. The source is released under MIT license so I’m sure you can generate outline mesh at runtime with few code modifications.

GlaDOSik | 2016-10-16 23:25