Dot pattern as UI image

Hi,

I am trying to create a similar pattern to this as a UI shader effect.

The main issue is that I think I need to get the rect scale inside the sader and I don’t think Unity natively supports that.

Is it possible to achieve this effect procedurally? I think there is some new UI shadergraph integradion with newer versions of Unity but not sure if what I want can still be achieved.
@FredMoreau

Hi @Finijumper ,

It seems you’re using the Dots pattern, which doesn’t have UV input. But if you double click on that node, since it’s a Subgraph, you can go and copy/paste its content.

You can then use a Position node, along with an Object node to get the bounds and do some math, depending if you want a constant screen density, or something that scale with the Canvas.

Hope this helps.

Hi @FredMoreau , thanks for your reply.

The image I shared is from Photoshop. Where can I get the Dots pattern in your screenshots?

It’s part of ShaderGraph’s “Procedural Patterns” Sample, that you can install from the Package Manager.
Once installed, you’ll find it under /Patterns/Simple/Dots.

9369992--1310507--Screenshot 2023-09-27 at 11.10.42 AM.jpg