Is it possible to make a dot matrix look with cycles?

I attempted this with the following node setup:

enter image description here

However, the dots should be round, and each dot should only have one color. As you can see, this is not the case:

enter image description here

This was possible in BI with a technique described on the wiki.

How can I achieve this?


1 Answer 1


How about something like this?

Dot matrix example

Or, even more fun:

Glowing dotmatrix – what could be better!

Or a ball:

So much fun

Or a tribute to the question author:

Yet another "example"

(I am having way too much fun with this)

The dot aspect ratio depends on your UV unwrap, so you can customize it as you want. I have gotten them to be square on a non-square image, but having a square image makes it a lot easier. Workflow:

  1. Identify the nearest hole.
  2. Find the distance to the hole.
  3. If the distance is greater than the radius, use transparent. Otherwise, use the central color of the center of the hole.

EDIT: GitHub user @JayFoxRox has kindly suggested some helpful simplifications to the below node setup. Instead of computing distance by taking the square root of the sum of the squares of components, simply compute squared distance by taking the dot product of the two inputs via the Vector Math node. (Then, of course, compare this to the squared radius instead of the raw radius.) And the “Combine Vector” and “Separate Vector” node groups now exist as first-class “Combine XYZ” and “Separate XYZ”, anyway. Thanks!

Blendfile: Dropbox, Blend-Exchange.


How to use this node group

Main node setup (right-click → Open Image in New Tab to see larger):

Main node group, "DotMatrix"

Separation (top) and combination (bottom): (would be nicer if it were built-in)

Node groups "Separate Vector" (top) and "Combine Vector" (bottom)

Distance: (Pythagorean theorem/Euclidean norm)

Node group "Distance"

  • $\begingroup$ @Mentalist: Thanks for rehosting the link. $\endgroup$
    – wchargin
    Commented Feb 23, 2018 at 23:10
  • $\begingroup$ Great job, very useful could I ask a question? How can change the number of dot matrix? Thanks in advance france $\endgroup$
    – france
    Commented Sep 25, 2018 at 13:42
  • $\begingroup$ @france Have you tried playing with the "spacing" and "radius" inputs? $\endgroup$
    – gandalf3
    Commented Sep 25, 2018 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .