[METAL] Texture Paint Color Picker picks wrong colors #106103
Labels
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106103
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: macOS-13.2.1-x86_64-i386-64bit 64 Bits
Graphics card: Metal API AMD Radeon Pro 580 1.2
Blender Version
Broken: version: 3.5.0 Release Candidate, branch: blender-v3.5-release, commit date: 2023-03-24 01:57, hash:
6caccf6b9f20
Worked: It worked correctly in Blender 3.4.1 for me
Short description of error
If I hold down the S Key for sampling a color in 3d view, it picks most of the time the background color of a textture and not the color under the Mouse Pointer.
Look into the screenshot onto the palette. These "colors" I pickes over the blue area in 3D View. They should be blue and not white.
You see it also while drawing with pressed S key in the color wheel in the picker on the right side. It samples blue, all values between and while, while I'm over the blue area. Shading is set to flat ...
In 2D-View it works as expected.
Exact steps for others to reproduce the error
Depending on the sampling point you should get the correct color, I don't
Unable to reproduce this on linux & nvidia hardware. Likely to be a metal-related issue.
Good point, will test.
Yes, works uner OpenGL.
Seems to happen only in METAL.
Texture Paint Color Picker picks wrong colorsto [METAL] Texture Paint Color Picker picks wrong colors@mano-wii , can you replicate the issue?
I can confirm the problem.
My impression is that the color Picker reads the object as if it had a different UV.
@Michael-Parkin-White-Apple Here is one for you.
Thanks for the report, i'll look into this.
I'm getting a separate assertion failure in
GPU_select_buffer_stride_realign
and also in the area size check in MTLFramebuffer::read if you hold down S and whizz the cursor around the view.When a fix is found, can hopefully also patch up any undefined paths.
if a quick fix is needed, skipping the data fetch from the paint and going straight to sampling the viewport framebuffer works fine in Metal
Skipping this check in
source/blender/editors/sculpt_paint/paint_utils.c :: paint_sample_color
if (v3d && texpaint_proj) {
GPU_backend_get_type() != GPU_BACKEND_METAL
and using the
GPU_frontbuffer_read_pixels
based fallback can work.Let me know if this is viable for a PR. I'll investigate a proper solution, but not too familiar with texture painting feature.
If I remember correctly,
GPU_select_buffer_stride_realign
was created becauseGPU_framebuffer_read_color
crashed on some older GPUs if it was required to read regions outside the framebuffer boundary.So a
rect_clamp
and the buffer needed to be corrected to match the originalrect
.The downside of using
GPU_frontbuffer_read_pixels
is that it returns the shaded image value. The user usually wants the original texture or colordata value. That's why a selection is made first to identify the polygon and thus read its data.As today has been set as the Blender 3.5 Release day (https://projects.blender.org/milestones), I'm not sure how this bug should be handled. @ThomasDinges should know?
Once this report is fixed in main, it can be backported for a 3.5.1 bugfix release.
The usual procedure applies @mano-wii :) For future issues on release day, please notify me on the chat.
Looks like this is a bug with
GPU_viewport_size_get_i
not correctly returning the contextual viewport size in Metal.Viewport returned by OpenGL:
VIEWPORT: 1219 41 1279 1548
Returned by Metal:
VIEWPORT: 0 0 3024 1694
(Which is the native backbuffer res).Likely a state issue of which current viewport is active at the time of sampling. Will submit a patch.
EDIT: comment in wrong report