← All ideas
  • Published 29 Dec 2024

Add a "Exists" socket to the Color Attribute node in Shader Nodes

Right now there doesn't seem to be a way for Shader Nodes to check if the mesh has vertex paint and output an alternative color if the vertex paint isn't there.

It'd be great if the Color attribute node had an Exists socket:

attr_exists.png

A practical example is having a node setup that would output the object's Object Color if the color attribute doesn't exist.

Right now this is not possible:

check.png

Workbench shading already does this when in attribute mode: if an object doesn't have an active color attribute, then it uses the object color.

100%

Development Status: Open

Upvote 15 Downvote 0
tolkfan
29 Dec 2024

2 Comments

thorn

Just this morning I was working on something, and wishing I had this sort of Switch Node exactly like this.

It's helpful when you are using a geonode to create an attribute for a shader, but for Reasons you want to temp disable the genode, but have a fallback value for the shader. So instead of returning Null (or whatever it's receiving), it would FALSE over to whatever is in that input.

2
Syroot

Still dearly looking for this.

I'm simulating another renderers shader which uses vertex colors for gamma correction. The default value is a 0.5 gray value (normal gamma), but if the attribute does not exist, the value fed to the shader will be 0.0 (0 gamma -> complete blackness). There's no perfect way to get a fallback or check in the shader at this time.