#Canvas Shader Graph image stretching

1 messages · Page 1 of 1 (latest)

urban juniper
#

Hello, I made a shader for the UI background, but the problem is that it's stretching on the whole image and looks distorted. Is there a way to make something similar to triplanar shader, where the size doesn't matter?

glossy forge
#

Using object, world or screen coordinates could be tricky because the Canvas and Canvas Scaler components work out the actual size of UI components under them using their scaling options, screen sizes and UI component anchors together so I think shaders don't have a typical way to access that info

#

Unless there's some nodes specifically for that

urban juniper
#

oh, actually, screen position node fixed that issue

glossy forge
# urban juniper

I assume this doesn't really account for different screen sizes, if that's needed

urban juniper
urban juniper
#

it doesn't work in play mode for some reason