2
$\begingroup$

I need to realize instances in order to apply later different set positions for each instance. But when realizing the instances, the texture does not behave correctly.

Here is what I did:

  1. Geometry Nodes graph that creates instances of spheres, then realizes.

    Here is an example of the geometry created from a plane object using this nodes graph:

  2. Shader node graph:

    enter image description here

    For a sphere it should create the following look. The noise is spread nicely.

    enter image description here

  3. The Geometry Nodes graph with "Set Material", but with muted "Realize instances" node.

    enter image description here

    Without "Realize Instances" node, the texture works well on the spheres:

    enter image description here

  4. The Geometric Nodes graph with "Set Material" and "Realize instances" nodes.

    enter image description here

    Now the textures are incorrect, and I don't know why and how to solve this.

    enter image description here

Would be happy for your help, Thanks!

$\endgroup$

2 Answers 2

3
$\begingroup$

Your stretch is caused by using the default coordinate system of the Noise Texture node, which is Generated - it's a normalized position, where the bounding box of the object is mapped to $0…1$ coordinates for each axis. Since your object's bounding box isn't equal on all axes - in quellenform's example it has dimensions 9, 9, 2, meaning the $z$ dimension is $4.5$ times smaller than either $x$ or $y$.

The simplest solution is then to use Texture Coordinate: Object instead:

The differences to quellenform's solution:

  • q: each ball has same pattern; me: each ball has a different pattern
  • q: as balls move, their patterns stay the same; me: the balls move through the pattern, so it depends on their position
  • q: as you warp (modify) the geometry, the pattern again stays the same, like here, which may be what you want, but it will again produce a stretch of the pattern when (inevitably) you stretch the geometry; me: just like with moving the balls, the vertices will move through the pattern, so it won't be stretched, but this also means an animation won't feel like objects stretching, which could be what you want to achieve

If you want a combination of q and me behaviors, ask another question and probably we can help with that.

quellenform:

me: [I've set up for myself a more favorable lighting so that it looks better]

$\endgroup$
4
  • $\begingroup$ +1 looks better to me ;) $\endgroup$
    – Chris
    Sep 18, 2023 at 10:05
  • $\begingroup$ That's a very informative and helps! Q method keeps the texture while moving, and yours keeps the texture un-stretched when deformed. $\endgroup$
    – audi02
    Sep 18, 2023 at 12:02
  • $\begingroup$ @audi02 you could combine the two by capturing the instance position and then offsetting (Vector Math: add) the texture coordinate by the captured position. $\endgroup$ Sep 18, 2023 at 12:35
  • $\begingroup$ @Markus von Broady, yes, I will try this. thanks! $\endgroup$
    – audi02
    Sep 18, 2023 at 13:27
2
$\begingroup$

In this case, since you have not assigned your own UV map to your UV sphere, the position of the points in the shader is used.

If you now instantiate several spheres at different positions and then realize these instances, of course these positions will also change.

A possible solution would therefore be to capture the positions in an attribute before instantiation, and to use this explicitly in the shader.

This could look something like this:

enter image description here


(Blender 3.6+)

$\endgroup$
1
  • $\begingroup$ That's a good one, and it keeps the texture while moving! $\endgroup$
    – audi02
    Sep 18, 2023 at 12:00

You must log in to answer this question.

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