Vertex color node and vertex attribute shader nodes don't produce correct vertex color values #71835

Closed
opened 2019-11-24 02:02:14 +01:00 by Olivier Riedo · 5 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: Quadro K2100M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 361.91

Blender Version
Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-11-22 18:14, hash: 373e936e3e
Worked: (optional)

Short description of error
The output of the vertex color node isn't the same as the value that was painted in. Specifically, it doesn't seem to be linearized. Neither is the (equivalent) output of the vertex attribute node set to the same color layer.

Exact steps for others to reproduce the error
From starting scene:

  • edit cube mesh, loop subdivide (ctrl-R) the vertical edges of the cube
  • in vertex paint, paint the four top vertices in full white (value 1), the four middle vertices in 0.5 value gray, the four bottom vertices in full black
  • in the shader node editor, link a "vertex color" input node set to the layer you just painted ("Col" by default) to a math node set to "greater than 0.5", link the math node to the material output node (as depicted in the screenshot)
  • set the viewport shading to material preview

vertexcolor.PNG

The expected behavior would be to have the separation between the white and black areas of the resulting material align with the edge loop formed by the four middle vertices with value 0.5, instead it occurs higher. Adding a gamma node with a gamma of 1/2.2 between the vertex color node and the math node moves the separation back where it should be, suggesting an incorrect or absent linearization from what I assume are sRGB values. Of course with that inverse gamma node added interpolation of the more or less corrected vertex color values won't be linear anymore. The same behavior occurs with the color output by the vertex attribute node, when set to a color layer. Although the math node is used to easily show the problem, directly linking the vertex color node to the material output won't produce the right values either.

The same behavior was observed in the 2.81 and 2.80 releases (although that earlier one didn't have the vertex color node, only the vertex attribute node). It happens in both Eeevee and Cycles renders.

**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: Quadro K2100M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 361.91 **Blender Version** Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-11-22 18:14, hash: `373e936e3e` Worked: (optional) **Short description of error** The output of the vertex color node isn't the same as the value that was painted in. Specifically, it doesn't seem to be linearized. Neither is the (equivalent) output of the vertex attribute node set to the same color layer. **Exact steps for others to reproduce the error** From starting scene: * edit cube mesh, loop subdivide (ctrl-R) the vertical edges of the cube * in vertex paint, paint the four top vertices in full white (value 1), the four middle vertices in 0.5 value gray, the four bottom vertices in full black * in the shader node editor, link a "vertex color" input node set to the layer you just painted ("Col" by default) to a math node set to "greater than 0.5", link the math node to the material output node (as depicted in the screenshot) * set the viewport shading to material preview ![vertexcolor.PNG](https://archive.blender.org/developer/F8160031/vertexcolor.PNG) The expected behavior would be to have the separation between the white and black areas of the resulting material align with the edge loop formed by the four middle vertices with value 0.5, instead it occurs higher. Adding a gamma node with a gamma of 1/2.2 between the vertex color node and the math node moves the separation back where it should be, suggesting an incorrect or absent linearization from what I assume are sRGB values. Of course with that inverse gamma node added interpolation of the more or less corrected vertex color values won't be linear anymore. The same behavior occurs with the color output by the vertex attribute node, when set to a color layer. Although the math node is used to easily show the problem, directly linking the vertex color node to the material output won't produce the right values either. The same behavior was observed in the 2.81 and 2.80 releases (although that earlier one didn't have the vertex color node, only the vertex attribute node). It happens in both Eeevee and Cycles renders.
Author

Added subscriber: @Olivier.Riedo

Added subscriber: @Olivier.Riedo

Added subscriber: @BartekMoniewski

Added subscriber: @BartekMoniewski

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bartosz Moniewski self-assigned this 2019-11-25 00:49:03 +01:00

Vertex colors in Blender (and many other DCC apps) are 8-bit sRGB, not linear.
Similar reports pop up sometimes but they all are invalid.
Support for generic vertex attributes with linear values would be great but that's a feature request.
https://devtalk.blender.org/t/full-precision-float-vertex-colors/4706
If you need precision for technical things I advise to use UVs. Linear, not-clamped, full float precision.

Vertex colors in Blender (and many other DCC apps) are 8-bit sRGB, not linear. Similar reports pop up sometimes but they all are invalid. Support for generic vertex attributes with linear values would be great but that's a feature request. https://devtalk.blender.org/t/full-precision-float-vertex-colors/4706 If you need precision for technical things I advise to use UVs. Linear, not-clamped, full float precision.
Bartosz Moniewski removed their assignment 2019-11-25 00:54:29 +01:00
Author

This comment was removed by @Olivier.Riedo

*This comment was removed by @Olivier.Riedo*
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71835
No description provided.