How to add a world-scale effect to a pixel-sized material?

Hi there,

I’ve got a material that’s only a few pixels big and I want to add a procedural dirtying effect to it using shader graph. I’ve got close, but I need it to apply along the mesh’s normals, whereas it looks like it’s currently applying from a single, fixed direction.

My shader graph is:

The “Normal Vector” and “Screen Position” are left over from failed tests. The closest I’ve got it working is with “Position” and either “Object” or “World” space. I’m looking at applying this dotted pattern for now, and I can get it looking like the following:

This shows that on one side of the mesh it’s working fine(ish), but on another side it’s infinitely stretched.

Any ideas on how to get it to apply correctly to all sides of the mesh?

Thanks!

The texture is stretching on the sides because you’re sampling the Voronoi texture using only the XY world coordinates, so it’s sort of like how one of the textures in this animation is overlaying.

You could try using the Triplanar Node to sample the voronoi texture (triplanar refers to how the image above uses three planes to texture an object without UVs: Triplanar Node | Shader Graph | 6.9.2

Or, you could use the object’s UV1s to sample the voronoi texture, maybe…? Not sure.

1 Like

Huge thanks for posting this. It easily explains where I was going wrong originally.

Don’t suppose you know how I’d get a Voronoi node into a triplanar node? :slight_smile: The triplanar node takes an input of Texture and I can only see 1 node with an output of Texture, and that’s one where you specify a Texture. There doesn’t appear to be any node that can convert that for me.