0

Does anyone know how to distribute a regularly spaced pattern across arbitrary geometry in Unity Shadergraph or HLSL?

Here are the requirements:

  1. The geometry will all have the same shader
  2. We know world-space vertex position and geometry normals
  3. Vertex density is arbitrary
  4. Geometry is generative so UVs are not pre-calculated
  5. The pattern can be generative or image-based, doesn't matter

The type of pattern I'm hoping to achieve would be a regularly spaced grid of dots. So far I've tried to take the frac of the world-space coordinates and use that to apply a regular grid of dots, however angled walls will have stretched or dim points, and some surfaces between the points display as totally dark.

I'm thinking I need to take some kind of 2D planar coordinate and rotate it, essentially on the fly UV creation. Ideally the pattern is fairly regular even on angled surfaces.

I've thought perhaps there is a way to achieve this with a cube-map?

I've also tried using tri-planar projection but the pattern has obvious artifacts at the seams.

Kit MacAllister
  • 234
  • 1
  • 8

0 Answers0