Vertex color is interpolated in the 3dview so you end up with a gradient from the colors instead of just flat colors #53316

Closed
opened 2017-11-13 21:21:42 +01:00 by Henrik Berglund · 6 comments

System Information
Win 8, GTX1070

Blender Version
Broken: 2.79 official (5bd8ac9) and newer (daily builds).

Short description of error
Vertex color is interpolated in the 3dview so you end up with a gradient from the colors instead of just flat colors. This makes sense if the colors were done on the vertices, but apparently vertex color is now a face thing, so why does the color bleed over other faces?

I attached a picture, the left grid (3x3 face grid) has the face in the middle painted red but the color turns into a gradient when it ideally shouldn't. The right grid has doesn't use vertex colors but instead has two materials, the middle face has a red material and the rest have a blue material applied. These grids should look the same.
bug_vertex_color_viewinterpolation.png

Because of this things like ID maps baked from vertex colors don't look as good as they should, you would want the colors to be "vertex accurate" (or in this case "face accurate") but you end up with a lot of unwanted smoothing/interpolation of the colors.

Exact steps for others to reproduce the error

  1. Create a grid with 4/4 subdivisions.
  2. Enter vertex paint mode.
  3. Fill the grid with a color (like blue).
  4. Draw on top of the middle face with another color, like red.
  5. You end up with interpolation between the faces with colors you didn't choose.
  6. Besides, why do you paint on vertices instead of faces if vertex color is now done on faces?
    bug_vertex_color_viewinterpolation.blend
**System Information** Win 8, GTX1070 **Blender Version** Broken: 2.79 official (5bd8ac9) and newer (daily builds). **Short description of error** Vertex color is interpolated in the 3dview so you end up with a gradient from the colors instead of just flat colors. This makes sense if the colors were done on the vertices, but apparently vertex color is now a face thing, so why does the color bleed over other faces? I attached a picture, the left grid (3x3 face grid) has the face in the middle painted red but the color turns into a gradient when it ideally shouldn't. The right grid has doesn't use vertex colors but instead has two materials, the middle face has a red material and the rest have a blue material applied. These grids should look the same. ![bug_vertex_color_viewinterpolation.png](https://archive.blender.org/developer/F1132680/bug_vertex_color_viewinterpolation.png) Because of this things like ID maps baked from vertex colors don't look as good as they should, you would want the colors to be "vertex accurate" (or in this case "face accurate") but you end up with a lot of unwanted smoothing/interpolation of the colors. **Exact steps for others to reproduce the error** 1. Create a grid with 4/4 subdivisions. 2. Enter vertex paint mode. 3. Fill the grid with a color (like blue). 4. Draw on top of the middle face with another color, like red. 5. You end up with interpolation between the faces with colors you didn't choose. 6. Besides, why do you paint on vertices instead of faces if vertex color is now done on faces? [bug_vertex_color_viewinterpolation.blend](https://archive.blender.org/developer/F1132688/bug_vertex_color_viewinterpolation.blend)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @cyaoeu

Added subscriber: @cyaoeu

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2017-11-14 11:41:26 +01:00

Thanks for the report, but no bug here, color data might be stored by face-vertex (aka loops), but tools are only designed to work on/with vertices. Doing otherwise would require developping some new tools (like some masking system e.g.).

For now, you can only achieve that kind of effect from code, e.g. to make default cube's first face all red:

mesh = C.object.data
col = mesh.vertex_colors.new()
for l in mesh.polygons.loop_indices:

col.data[l].color = (1.0, 0.0, 0.0, 1.0)

Thanks for the report, but no bug here, color data might be stored by face-vertex (aka loops), but tools are only designed to work on/with vertices. Doing otherwise would require developping some new tools (like some masking system e.g.). For now, you can only achieve that kind of effect from code, e.g. to make default cube's first face all red: ```lang=python mesh = C.object.data col = mesh.vertex_colors.new() for l in mesh.polygons.loop_indices: ``` col.data[l].color = (1.0, 0.0, 0.0, 1.0) ```
Author
Member

Thanks for the response. I was actually doing vertex colors using a script but I noticed I was using the "old" method of iterating on vertices, so I changed it to iterate on faces instead (resembling your code) and got more accurate results. :)

Still being able to paint on faces directly without using face selection masking would be nice in the future.

Thanks for the response. I was actually doing vertex colors using a script but I noticed I was using the "old" method of iterating on vertices, so I changed it to iterate on faces instead (resembling your code) and got more accurate results. :) Still being able to paint on faces directly without using face selection masking would be nice in the future.
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#53316
No description provided.