Search code examples
unity-game-engineshadershader-graphunity3d-shaders

How can I get the actual size of a gameobject in shadergraph?


I need to get the actual size of the object within shader graph. I currently only have the Object > Scale node or the option of manually setting the size of object in runtime.

Is there some way I can easily get the size of the object (or bounds) within shader graph?


Solution

  • Shader Graph 14.0.3 Object Node has,

    • World Bounds Min: Minimum value of the renderer bounds in world space
    • World Bounds Max: Maximum value of the renderer bounds in world space
    • Bounds Size: Size of the renderer bounds