1
$\begingroup$

I start with a cube and create a new material with an image texture. I then create a new geometry nodes modifier on the cube and assign the material through a "set material" node:

Cube with texture

Everything works as expected. But when I exchange the Group Input node with a cube node, the cube shows up in a single colour, likely the "average" colour of the texture:

enter image description here

Does anyone know how to fix this? Is this a bug?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

The way I see it, you have two options:

Either you reference the UV map of the cube automatically generated in Geometry Nodes with the node Attribute in the shader (Blender 3.1):

enter image description here
(Blender 3.1+)

Or you transfer the automatically generated UV map in Geometry Nodes with Store Named Attribute into the geometry. With this solution you copy the UV map of the cube ("uv_map") into the existing default UV map of the object ("UVMap"):

enter image description here
(Blender 3.2)

$\endgroup$
6
  • $\begingroup$ Thanks for your help. It did work for me in this minimal example, but in my case it's a bit more complicated. Instead of creating a new cube in geo nodes I reference a plane that I created by hand in Layout mode (because I didn't find a way to create planes in geo nodes). I tried both of your solutions and they didn't work in that case. I'll post the .blend file, maybe there's something I'm missing. blend-exchange.com/b/Yd9W1S12 $\endgroup$ Sep 13, 2022 at 10:10
  • $\begingroup$ @Balthasar1stern I don't understand your question here. Originally you talk about a GN created cube not having a UV map, and now you show an example where you change an existing object with an existing UV map? And I don't quite understand the structure of the scenery either: what do you actually want to do here? What is the goal? A cube created in GN has a UV map named "uv_map" and your existing objects have a UV map named "UVMap". And this setup here does what you describe: i.stack.imgur.com/gWPbO.jpg PS: And you can create a plane in GN with Grid $\endgroup$
    – quellenform
    Sep 13, 2022 at 10:57
  • $\begingroup$ @Balthasar1stern Can you please show this again in more detail using your specific example? I really don't know my way around right now and would love to help you. Thank you! $\endgroup$
    – quellenform
    Sep 13, 2022 at 19:43
  • $\begingroup$ The original question came up while trying to simplify my problem to a minimum. But as it seems I simplified too much. I'll try to explain my specific example: I want to create a scalable 3D "cardboard" in GN, therefore I need the wavy middle layer (currently muted) and the two outer layers. I downloaded a cardboard texture for the outer layers, but when I instanced them in GN the texture was displayed as a single color, even though the original (currently hidden) object displayed the texture. I may have found a solution though. I'll report back in a few minutes. $\endgroup$ Sep 14, 2022 at 13:13
  • $\begingroup$ > i.stack.imgur.com/gWPbO.jpg This solved my problem. I still don't understand why the UV information is lost when instancing an object though. I managed to do it with grids now and completely got rid of my "front layer" and "back layer" objects. To get the texture to show on the GN generated "planes" I used your first solution with the added attribute "uv_map". blend-exchange.com/b/JW5zZkmB $\endgroup$ Sep 14, 2022 at 13:43
0
$\begingroup$

I don't think that the Cube node has UVs. If so the color corresponds to the pixel at coordinates 0,0 on your image.

You can generate UVs directly in geo nodes though. DefaultCube shows how to do it in this video

$\endgroup$
2
  • $\begingroup$ Yes, of course the Cube in 3.2.2 has a UV map called "uv_map". $\endgroup$
    – quellenform
    Sep 1, 2022 at 13:02
  • $\begingroup$ Oh my bad then, thx ! $\endgroup$
    – holybobine
    Sep 1, 2022 at 13:25

You must log in to answer this question.

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