Using a shader with the new UI? [RawImage]

I created a post earlier about the requirement of blurring an image with a set intensity and I was directed to use shaders by numerous people. Finally I scrapped up the money to purchase some shaders that did what I wanted and looked really nice, but then I realized an issue. How the hell do I apply a shader to a UI element.

The UI element that I use is a RawImage and I’m very confused and quite upset about my purchase at this point.

Regards, Chris.

You apply the shader to a new material. Then you apply the material to the Image/RawImage Material property.

Note, shaders may need tweaking to be used by UI due to the way they apply lighting.

I’m not a shader person but I saw this mentioned a few times during the beta. Try it and see if everything is ok first.

This looks correct in the scene view, however in the game-view it’s stuck on white, unfortunately :frowning:

Hmm, that could be a bug. Did see one related issue that is fixed in 5.0.2.

@Aras Any ideas why a shader would work in scene view on UI but not in Game view? /cc @phil-Unity

1 Like

Do you have your canvas set to Screen Space Overlay? Try Screen Space Camera.

2 Likes

Not to necro this thread too hard but this was exactly the solution I needed to get my minimap overlay displaying as a circle instead of a square. Thanks!