u/DreamedLint

Using the Swirl Shader with a Canvas Image

Using the Swirl Shader with a Canvas Image

I need some help understanding shader coding. I've been using this tutorial/example (https://docs.unity3d.com/6000.3/Documentation/Manual/ui-systems/create-custom-swirl-filter.html) to create a custom swirl shader that does indeed work in the new UI Toolkit pipeline.

Working as expected

However, when I apply it to an image on a canvas, I can't even get the image to display. Now, I'm aware this is for a UI Toolkit so I wasn't expecting it to be as simple as just dragging and dropping the shader onto the material in the old UI setup. I'm mainly wondering what makes this type of shader incompatible with the sprite when applied in this way? Is there something I can do in the shader code to get it to work with the old UI but still expose the properties of Angle and Radius to potential scripting? Or am I totally off-base and that is completely incompatible with the old UI?

I figured the image would at least show up in the main camera preview

How it looks with a default material

Should the shader be using the sprite as the Texture? Or should it be a transparent texture over the sprite?
(image is just a placeholder to demonstrate the effect)

Thanks for the help and I'm sorry if this is a hassle or it's in the documentation somewhere and I just can't figure it out.

reddit.com
u/DreamedLint — 9 days ago