0
$\begingroup$

I'm attempting to define a float value for a face dependent on its location on the z-axis (image 1). I have set up a shader to visualize the float value (image 2). I would expect the value determined from the separated z-axis to be the same for all faces with the same z-height- however this is not the case. The values radiate out from the center of the grid instead of forming parallel lines. How can I fix this?

Image 1: Geometry nodes

Image 2: Visualizer

$\endgroup$
2
  • $\begingroup$ i don't see anywhere in your node tree where you are setting the z-value to your position? if it is set in the mesh, just use "position -> separate -> z into store named attribute" - no more and it will work $\endgroup$
    – Chris
    Commented May 13 at 4:57
  • $\begingroup$ @Chris Thanks. It seems that normalizing interfered with the separate z output. Map range has sorted it. $\endgroup$
    – barbarossa
    Commented May 14 at 4:37

1 Answer 1

0
$\begingroup$

Removing the Normalize node and mapping to range has made the values store properly.

Taking minimum and maximum face positions allows this to be applied to geometry of any size. Updated nodes

$\endgroup$
2
  • 1
    $\begingroup$ Side note: The Attribute Statistic node could be set of type Float to work only on component Z instead of the whole Position vector, saving a bit of time and two Separate XYZ nodes. $\endgroup$ Commented May 14 at 6:09
  • $\begingroup$ @StefLAncien That produces a strange result- the faces where z=1 are shifted downwards (by 2.2, it appears)- the faces are blue from halfway up/down. $\endgroup$
    – barbarossa
    Commented May 14 at 23:25

You must log in to answer this question.

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