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

Godot Version

4.2.2.stable

Question



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.

Hey there! I’m in a similar situation, did you ever find a solution for this?
I keep seeing mention of the triplanar node but I can’t seem to figure out how to make that work with a non-texture material.