6
$\begingroup$

I'm new to geometry nodes in 3.0 and a bit stuck on understanding how to output data. I've spent a fair bit of time searching this, but perhaps I don't understand the system well enough to find the answers I'm looking for.

What I want to do is fairly simple: I would like to write to the vertex color of a mesh using geometry nodes.

I've been able to write a color to an attribute that I can reference in the material shader graph, but I'm unsure how to write the data to the mesh vertex color attributes.

Here's my best attempt, with no luck.

enter image description here

Is this possible or outside the intended use of the system?

Any help is much appreciated, thanks!

Brandon

$\endgroup$
3
  • 1
    $\begingroup$ Any chance this is an XY problem? What is the purpose of getting the output data into a vertex color? $\endgroup$
    – ajwood
    Dec 11, 2021 at 0:22
  • $\begingroup$ @ajwood Personally, I'm interested in this question because it seems like outputting to Col should work, but it doesn't. I upvoted this question because I'm hoping any answer can shed light on other use of 3.0 Geometry Nodes. $\endgroup$
    – Nathan
    Dec 11, 2021 at 17:26
  • 1
    $\begingroup$ @ajwood - my usecase here is to get the model out of Blender with the vertex color written to the mesh. The only other alternative I had was to BAKE to vertex color into the mesh, but it would be much easier to do it through the nodes. $\endgroup$ Dec 13, 2021 at 15:41

3 Answers 3

7
$\begingroup$

You need to Capture the attribute if you want to write it to every geometry element from within the domain you chose.

As it stands, although you did setup the output to write data on face corners, the data is not actually filled in. One could argue the default field value should be written to all geometry elements by default though.

Try this setup :

enter image description here

enter image description here

Result :

enter image description here

$\endgroup$
5
  • $\begingroup$ Thanks Gorgious, that solves my problem exactly and helped me understand the capture attribute node better! The workflow there does seem a little unintuitive as I had expected the graph's GroupOutput node to be where the data would be written. Anyways, thanks for the help! $\endgroup$ Dec 13, 2021 at 15:35
  • $\begingroup$ Excuse me, how do you display the color from the value right in the viewport?) $\endgroup$
    – 3DBear
    Jan 30 at 12:51
  • $\begingroup$ @3DBear Go to the viewport shading settings in the top right of the 3D viewport and choose "Vertex" display mode $\endgroup$
    – Gorgious
    Jan 30 at 14:42
  • $\begingroup$ Somehow can't make it work. What am I missing? T_T i.gyazo.com/23c2a7741648ab271df6db4d416a5bf3.png $\endgroup$
    – 3DBear
    Jan 30 at 16:08
  • $\begingroup$ @3DBear Yes apparently this specific workflow doesn't work on 3.0, I don't really know why sorry $\endgroup$
    – Gorgious
    Jan 30 at 17:37
4
$\begingroup$

To add a little to @Zero's answer..

  • As @Zero shows, you can set up the Modifier UI to enter a colour, albeit with a buggy colour-wheel (as at time of writing, 3.01, stable) . Numerical entries are OK.

enter image description here

  • You can also set colours in-tree, where the colour-wheel works OK:

enter image description here

Just something to be alert to, though. Colours set in the Vertex Paint workspace appear to undergo conversion to sRGB, as displayed there, and when stored. The color (on the left, below) called (0.5,0,0) in the Vertex Paint workspace appears as (0.218,0,0) in the GN spreadsheet, and when referenced by a shader:

enter image description here

$\endgroup$
7
  • $\begingroup$ I've followed the steps in your answer, but the material is all black. I have a Vertex Color node connected. The vertex color index named Col is listed in Object Data Properties. I'm using 3.0.1 Do you have any idea what could be wrong? $\endgroup$
    – Mentalist
    Mar 1 at 4:46
  • $\begingroup$ Hi, @Mentalist ! .. it could be a number of things.. if you share a minimal version of your problem on pasteall.org/blend , we could have a look? $\endgroup$ Mar 1 at 6:28
  • 1
    $\begingroup$ Hi, @Mentalist ! Don't ask me to make sense of this, but at the moment, once an attribute has touched the GN system, it becomes a GN attribute. Presumably we can look forward to better integration as the system settles down: imgur.com/a/tu3xE2x $\endgroup$ Mar 1 at 14:01
  • 1
    $\begingroup$ Thank you! I had previously tried the Attribute material node, like in your screenshot, but I think the reason I didn't realize it was working is that the color wheel input of the GeoNodes modifier is buggy right now (seems only to accept solid RGBCMYKW). But sending any color through the GN Group Output node works. In doing so, I realized a vert group can be used to factor a Mix node and output gradients. :-) $\endgroup$
    – Mentalist
    Mar 1 at 17:53
  • 1
    $\begingroup$ I should mention that the Capture Attribute node in my screenshot is not necessary to achieve that result. Had I noticed sooner I would have deleted it. $\endgroup$
    – Mentalist
    Mar 1 at 18:08
3
$\begingroup$

Thanks, your post help me, I see that in blender 3.0.0 - 3.2.0 if you set material to the object, chose in the base color Attribute color and in the name write col it is still working.

Just the bar of the grey scale value not work from the right slider, but you can adjust this from the value from the second slider.

enter image description here

enter image description here

$\endgroup$

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.