Blender export settings Shadergraph Working Case : when object size is withint 2,2,2, world origin is 0,0,0, object pivot is middle (1,1,1) Not working when... 1. the object size exceed 2x2x2, same position with the image above, scale :1 2. when object origin is on its feet (bottom) Expected result : Color lerping between top and bottom of the object based on the object's height no matter how big is and when its exported position is like the last picture (origin is its feet where 0,0,0 in my blender scene) Hi, I'm having an issue with my shader using object position. basically lerping two colours based on object Y axis. My expected result is having two colours blendeing between top to bottom of an object no matter how how big or small its size is. and preferably the objects should have pivot at theirs feet (0,0,0) I assume the object space in my shadergraph only count 1x1x1 and anything exceeding this area will have the sharp dividing line. wonder if there's any way I can set them as literally object size (scale 1)? Any input from you would be very helpful Thanks. Cheers!
This is normal behaviour. The position value is relative to the mesh's "pivot" point and are only going to be in the 0-1 range if the pivot is at the feet and the object is export with the top of it only reaching 1 unit high. The only way to get the behaviour you're expecting for any arbitrary object is to create a Min and Max property value in your shader graph which you can set on the material, this will be your object bounds' min Y and max Y values to set. Then you can use a "remap" function to map the existing position values to 0,1 range using those min/max values.
You don't, you get it on the C# side and set the values on some properties you've defined on the graph. You can access the bounds from the Renderer component on your object and assign that to the material.
As of ShaderGraph 14.0, you can access the Renderer bounds via the Object Node: https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/Object-Node.html
There is an issue. Render bounds work differently in main, shadow and wireframe passes. You can see that the foliage is shadowed by copy of itself in the wrong position