1
$\begingroup$

While trying to create a pixelated effect, I noticed that using vectors causes overlapping lines in x- and y-direction. As far as I can see, there is no good solution to create pixelated faces...

Has anyone got good solution for this kind of problem?

The origin is in the bottom of the object.

Overlapping lines

$\endgroup$
3
  • $\begingroup$ I'd call these "overlapping lines" just seams. The problem is not trivial and is caused pixels on opposite side of the seam to be snapped to different values. In other words, those seams mark the snapping edge on some axis (I bet you could put planes, one on each of the seams that they would align with them perfectly). So your snapping will only work if the geometry is made of aligned voxels. Also, if each of the dimensions of 6 sides (NSWE, top, bottom) expressed in tiles isn't an integer - you must get a seam on an edge of that side. $\endgroup$ May 12 at 23:04
  • $\begingroup$ You can consider UV unwrapping and then putting a low-res texture on your geometry (which is very standard approach), or detecting which side you're on and only snap to 2 axes different than its normal. I reproduced your issue: i.imgur.com/pKPZQUR then tried that: imgur.com/mgTntpv even alternating to which axis the border between cardinal sides snaps: imgur.com/rPqciZb all ugly. You can put tiles radially, but then you have to figure how to do the top: i.imgur.com/Cy1oNZ7 I think the problem comes down to tiling a ball with squares i.imgur.com/EJegL15 $\endgroup$ May 12 at 23:17
  • $\begingroup$ I agree, this solution works better with UV-mapping in this situation. $\endgroup$
    – Treslav
    May 13 at 4:43
2
$\begingroup$

As I wrote in the comments, some seams are inevitable. Even on a cube, if a side is 1.1 m long, and a tile is 0.2 m long, then 5 tiles will fit completely and half of a tile will be cut off in middle (giving an impression of a seam). What if you don't have a cube? Any non-vertical face will be visible from side as a diagonal line, which will not be compatible with squares that you look at en face.

Another way to look at it is this: if you were able to procedurally draw squares on an arbitrary figure without seams, it would mean you tessellate that figure with squares, which I think is fair to say is impossible - spheres in Blender are made either from triangles or from heavily stretched quads (and some triangles on top and bottom if you don't cast a subdivided cube into a sphere).

So while some seams (on the left) seem to be unavoidable, the seams inside NSWE, top, bottom sides can be avoided (on the right):

I came up with a basic setup like this:

By increasing Epsilons, you remove the inner seams by removing the normal-aligned axis information from the vector:

You will still get seams on areas between those "flattened" areas.

You could improve that node setup, or maybe instead create a black texture and use R/G/B information, and draw on that texture:

Best to draw in Add mode to add flattening (use the color of an axis visible on the gizmo: X:red, Y:green, Z:blue), and Subtract mode to remove flattening. I'd recommend falloff set to constant.

Perhaps a better idea is to make that information only offset the coordinates, so you're not forced to draw on an entire side of the object, and can just draw on a part of a square on one side of a seam.

$\endgroup$
7
  • 1
    $\begingroup$ Possibly useful: blender.stackexchange.com/questions/21001/… $\endgroup$ May 13 at 10:42
  • $\begingroup$ Let's simplify the problem. The original form is cube that has been subdivided in every direction once and vertices offset a little bit. Simplified rock picture We have 24 faces to project the pixelated noise on to. $\endgroup$
    – Treslav
    May 13 at 11:01
  • $\begingroup$ @Treslav I think in this case you can decide which axis to ignore based on the face normal. $\endgroup$ May 13 at 11:08
  • $\begingroup$ What node should be used to define the face normal? @Broadysmile $\endgroup$
    – Treslav
    May 13 at 11:21
  • $\begingroup$ @Treslav Texture Coordinate > Normal. The biggest component will be the axis you want to ignore (multiply by 0) $\endgroup$ May 13 at 11:31
1
$\begingroup$

why don't you use it like this?

enter image description here

result: enter image description here

with 0.02:

enter image description here

$\endgroup$
3
  • $\begingroup$ His geometry is not so regular and that's the cause of his problem. I think your solution will result in the same problem on his geometry. $\endgroup$ May 12 at 20:41
  • $\begingroup$ @MarkusvonBroady: aaaaah yes, you are right!!! $\endgroup$
    – Chris
    May 13 at 4:21
  • $\begingroup$ Is it not possible to use the object origin as the start point and point the vectors towards face normals? $\endgroup$
    – Treslav
    May 13 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.