Triplanar on a non-texture (Or prevent shader stretching)

Godot Version



Relevant images. When an object is resized or scaled, the “borders” become stretched out. I want to keep the borders a set thickness regardless of the size/scale of the object.

The triplanar node that Godot provides seems like it’s only used for actual texture inputs. I should say that I tried converting a spatial material with the triplanar setting enabled into code, but I couldn’t quite reverse engineer it for visual shader.