The colors of the vertices do not correspond to the values in which I paint them with vertex paint. #91759

Open
opened 2021-09-27 22:19:33 +02:00 by Alexey · 9 comments

System Information
Operating system: Windows-10-10.0.14393-SP0 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38

Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 02948a2cab
Worked: (newest version of Blender that worked as expected)

Short description of error
the vertex color values that I get from the vertices in the shader editor node called "vertex_color" do not correspond to the values that I write there using vertex painting.

Exact steps for others to reproduce the error
vertex_color.gif
[Please describe the exact steps needed to reproduce the issue]
Set the viewport mode to render or material preview. And change the inputs from the manual value to the value taken from vertex color. As you can see, the values themselves should not differ, but the color change.

[Based on the default startup or an attached .blend file (as simple as possible)]
vertex_color_error.blend

Perhaps this is due to this issue https://developer.blender.org/D10956, but I want to say that we then need the ability to convert from one color space to another.
Because I use a blender to create game models and would like to use vertex colors to mix materials. But I can't, because it doesn't correspond to the colors and values that I enter. And it will not match what I will see in the game.
In addition, I enter specific values using the color wheel and sliders. And I expect to get them unchanged. That would be logical.

**System Information** Operating system: Windows-10-10.0.14393-SP0 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38 **Blender Version** Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: `02948a2cab` Worked: (newest version of Blender that worked as expected) **Short description of error** the vertex color values that I get from the vertices in the shader editor node called "vertex_color" do not correspond to the values that I write there using vertex painting. **Exact steps for others to reproduce the error** ![vertex_color.gif](https://archive.blender.org/developer/F10637884/vertex_color.gif) [Please describe the exact steps needed to reproduce the issue] Set the viewport mode to render or material preview. And change the inputs from the manual value to the value taken from vertex color. As you can see, the values themselves should not differ, but the color change. [Based on the default startup or an attached .blend file (as simple as possible)] [vertex_color_error.blend](https://archive.blender.org/developer/F10637862/vertex_color_error.blend) Perhaps this is due to this issue https://developer.blender.org/D10956, but I want to say that we then need the ability to convert from one color space to another. Because I use a blender to create game models and would like to use vertex colors to mix materials. But I can't, because it doesn't correspond to the colors and values that I enter. And it will not match what I will see in the game. In addition, I enter specific values using the color wheel and sliders. And I expect to get them unchanged. That would be logical.
Author

Added subscriber: @lexpartizan

Added subscriber: @lexpartizan

#92082 was marked as duplicate of this issue

#92082 was marked as duplicate of this issue

#90223 was marked as duplicate of this issue

#90223 was marked as duplicate of this issue

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Thanks for the report,

I'm not familiar with this area, so for me it also seems to be a bug.

One thing to keep in mind first is that loop colors are stored in byte channels {255, 255, 255, 255}.
So it's impossible to have an exact {0.9, 0.9, 0.9, 1.0} value.
The closest would be {0.90196078431, 0.90196078431, 0.90196078431, 1.0} which corresponds to {230, 230, 230, 255}.

Reading the value of Mesh->mloopcol, they show {230, 230, 230, 255} which corresponds to 0.9 in RGB linear space.
But apparently Cycles, Spreadsheet and Draw Manager consider mloopcol to be sRGB and not the linear RGB.
The mloopcol values are converted to float using BLI_color_from_srgb_table[230].

So apparently Vertex Paint is forgetting to convert the color in the Color Picker to sRGB.

This appears to be a bug.

Thanks for the report, I'm not familiar with this area, so for me it also seems to be a bug. One thing to keep in mind first is that loop colors are stored in byte channels `{255, 255, 255, 255}`. So it's impossible to have an exact `{0.9, 0.9, 0.9, 1.0}` value. The closest would be `{0.90196078431, 0.90196078431, 0.90196078431, 1.0}` which corresponds to `{230, 230, 230, 255}`. Reading the value of `Mesh->mloopcol`, they show `{230, 230, 230, 255}` which corresponds to `0.9` in `RGB` linear space. But apparently `Cycles`, `Spreadsheet` and `Draw Manager` consider `mloopcol` to be `sRGB` and not the linear `RGB`. The `mloopcol` values are converted to `float` using `BLI_color_from_srgb_table[230]`. So apparently Vertex Paint is forgetting to convert the color in the Color Picker to `sRGB`. This appears to be a bug.
Author

As far as I understand you, the colors themselves in the vertices are quite correct. Just a blender using the vertex_color node produces a non-linear sRGB. I am glad to hear that.
Accuracy is not so important, small differences are quite acceptable, but here the differences are visible to the naked eye and they change from value to value. The problem is also that very often (in my case) vertex color is used not only for the image of colors, where differences in color have a visual component, but also as masks or maps of materials, where compliance matters. I use this to mix materials, however, due to such transformations, I get a very unexpected result, different from what will be in the game, for example.

As far as I understand you, the colors themselves in the vertices are quite correct. Just a blender using the vertex_color node produces a non-linear sRGB. I am glad to hear that. Accuracy is not so important, small differences are quite acceptable, but here the differences are visible to the naked eye and they change from value to value. The problem is also that very often (in my case) vertex color is used not only for the image of colors, where differences in color have a visual component, but also as masks or maps of materials, where compliance matters. I use this to mix materials, however, due to such transformations, I get a very unexpected result, different from what will be in the game, for example.

Added subscribers: @Consta, @EAW, @scurest

Added subscribers: @Consta, @EAW, @scurest

Added subscriber: @barakooda

Added subscriber: @barakooda
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:11:45 +01:00
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
3 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#91759
No description provided.