8
$\begingroup$

I found this answer by Nathan: Weight paint in cycles nodes?

This is exactly what i want to do: use vertex weight value for "changing colors"/"use in shaders".

Nathans answer seems to be the solution, but...i don't understand it and i don't know how it works. Can somebody give me a step by step tutorial how to do it?

$\endgroup$
14
  • $\begingroup$ I'll leave it for a while to see if @Nathan is around.. that's only polite :). In the meantime, I assume you've already seen this $\endgroup$
    – Robin Betts
    Commented Jun 25, 2021 at 9:07
  • 2
    $\begingroup$ maybe you should put a comment under his answer and ask for some precisions? $\endgroup$
    – moonboots
    Commented Jun 25, 2021 at 9:21
  • 2
    $\begingroup$ @Chris I'm sure it's nothing personal.. Nathan is probably looking for a specific query to answer: with the description already given, it's hard to know what to clarify further... there are quite a few possible gotchas. In the mean time, here's a blend file $\endgroup$
    – Robin Betts
    Commented Jun 26, 2021 at 10:17
  • 1
    $\begingroup$ I got it working now with your geometry nodes solution ;) my main problem was - it works only in cycles and i always tested with EEVEE 🤦‍♂️ but MANY THANK YOU AGAIN AND AGAIN for your blend file. -> good idea to write the explanation in the text file, especially for me, who doesn't know what I did last week...😱 $\endgroup$
    – Chris
    Commented Jun 26, 2021 at 12:38
  • 1
    $\begingroup$ ok, i now try to understand Nathans solution - because it works in EEVEE. Rendering in cycles needs days for what i am looking for....😱😱😱 $\endgroup$
    – Chris
    Commented Jun 26, 2021 at 12:44

2 Answers 2

15
$\begingroup$

With the geometry nodes it is now possible to use the weight almost directly (however I believe the "Vertex group" node will be added to the shader nodes some day to make it straightforward). Just add geometry nodes modifier to your object and use "Capture attribute" node to make the weight available as an attribute in your shader. Below I have "w1" vertex group and "weight" attribute injected by geometry nodes. Then use this new attribute in the shader.

weight painting

geometry nodes

attributes

shader

$\endgroup$
1
  • $\begingroup$ Thank you so very much! Really appreciated! :-) $\endgroup$ Commented Sep 9, 2022 at 10:54
2
$\begingroup$

All it takes is geometry nodes with an input socket connected directly to an output socket. In the GeometryNodes modifier, you can set input to your vertex group, and output to an attribute for access in your shader. how to use a vertex group in a shader

$\endgroup$

You must log in to answer this question.

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