1
$\begingroup$

I have found a way to change the color of a grid based on the proximity of a mesh. However, the color of each tile of the grid is dependent upon the tile's z location.

Here's an image of what I have: enter image description here

What I have was achieved with geometry nodes on a plane and with shading nodes on the selected sample cube:

Here are the geometry nodes on the plane:

enter image description here

Here are the shading nodes on the sample cube:

enter image description here

Here is a file of what I've shown so far:







I want for the proximity of a mesh to affect the color of the plane the same exact way as shown above, but without affecting the height of each pixel cube.

I have gotten something to work, but only based upon the distance of the center of a mesh and each pixel cube, which is not the same as the distance between the nearest face of some mesh and each pixel cube.

Here's an image at what I have as an attempt at a solution: enter image description here

If I drag the selected grid around in object mode, the color in the plane changes. However, the color of the pixels in the plane are dependent upon the location of the selected grid, which is it's center.

My attempt at what I want was achieved by not calculating distance in geometry nodes, but calculating distance purely in shader nodes.

Here are the geometry nodes of the plane in my attempt: enter image description here

Here are the shader nodes of the sample cube in my attempt: enter image description here

Here is the file of my attempt:

$\endgroup$

2 Answers 2

3
$\begingroup$

This can be done in 3 steps:

enter image description here

  1. Geometry proximity output should be connected to Geometry Nodes group output.
    In my example, I used capture attribute node to make value equal in each instance of the cube. Important note: To pass different values to different cubes instances should be realized.

  2. In Geometry nodes modifier, type a new attribute name for export from Geometry Nodes

  3. Get this attribute in shader nodes using Attribute node and name that you have typed in step 2.

$\endgroup$
2
  • $\begingroup$ I tried this out and apparently I'm doing something wrong. Can you spot it by chance? imgur.com/a/uVPiaSR $\endgroup$ May 27, 2022 at 20:32
  • $\begingroup$ Read my answer carefully: Important note: To pass different values to different cubes instances should be realized. $\endgroup$
    – Crantisz
    May 28, 2022 at 9:34
2
$\begingroup$

Just a variation on @Cranitsz' answer, saving a mapping of the proximity..

By proximity to instance, as he does:

enter image description here

By proximity to vertex, not unlike your first example:

enter image description here

... and I got stuck trying to do it by proximity to face, which Cranitsz essentially answered here

$\endgroup$

You must log in to answer this question.

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