2
$\begingroup$

I made a procedural polka dot shader. It's applied to a flat n-gon, rounded via subdiv surface modifier.

enter image description here

I'd like to eliminate all dots that are not fully contained inside n-gon edges. To do this the shader would need to determine the distance from a tile center to the nearest edge. Is there a way or some trickery to query this?

I looked into existing posts regarding similar problems, namely this one and this one but still can't get wanted results. Seems that output of nodes that rely on sampling (ao or bevel) can't be properly threshold-ed for shader to determine if a position is far enough from an edge. For example the ao shader output connected via "less than" node will still produce a falloff, as seen on the image below.

enter image description here

Any suggestions would be greatly appreciated!

$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .