Regression: color attribute is emitted as black on Eevee #104370

Closed
opened 2023-02-06 04:58:59 +01:00 by Scurest · 8 comments
Contributor

System Information
Operating system: Linux-6.1.6-arch1-3-x86_64-with-glibc2.36 64 Bits
Graphics card: Mesa Intel(R) HD Graphics 4600 (HSW GT2) Intel 4.6 (Core Profile) Mesa 22.3.3

Blender Version
Broken: 3.3.2
Worked: 3.2.2

Caused by 1998269b10

Short description of error
In a specific mesh with two color attributes, and 16 materials, a Color Attribute shading node will suddenly start emitting black

Exact steps for others to reproduce the error

  • Open attached file or:
    • Delete default Cube
    • Run this script - It will create a cube with two color attributes, one red, one green. The first fifteen material slots are filled with a material that shows the red color attribute, the sixteenth, with one that shows green. Finally the faces are assigned the sixteenth slot. The cube should therefore appear green.
import bpy

def create_mat(vc):
    mat = bpy.data.materials.new(f"Mat {vc}")
    mat.use_nodes = True
    mat.node_tree.nodes.clear()
    node_vc = mat.node_tree.nodes.new('ShaderNodeVertexColor')
    node_out = mat.node_tree.nodes.new('ShaderNodeOutputMaterial')
    node_vc.layer_name = vc
    mat.node_tree.links.new(node_vc.outputs[0], node_out.inputs[0])
    return mat

bpy.ops.mesh.primitive_cube_add()
ob = bpy.context.object
ob.data.vertex_colors.new(name="Red").data.foreach_set("color", [1,0,0,1]*24)
ob.data.vertex_colors.new(name="Green").data.foreach_set("color", [0,1,0,1]*24)

mat_red = create_mat("Red")
mat_green = create_mat("Green")
for _ in range(15):
    ob.data.materials.append(mat_red)
ob.data.materials.append(mat_green)

ob.data.polygons.foreach_set('material_index', [15]*6)
  • Got to material preview mode,
  • enter edit mode (alternatively, rename the mesh or add a material slot).
    The cube will suddenly become black. It remains black even if you exit edit mode.

To fix it temporarily, exit edit mode, switch to solid shading mode and view the Green color attribute in Attribute mode. Switch back to material preview mode and it will be fixed until you trigger it again.

Removing unused material slots fixes it permanently.

Other
This is an extremely weird bug. It's reduced down from a case with many more material slots, all different, and all used (so removing unused slots won't fix it). I couldn't repro without two color attributes and at least 16 material slots. Note that it depends not only the number of slots, but the exact pattern of materials in them.

eevee_attribute__bug.blend

**System Information** Operating system: Linux-6.1.6-arch1-3-x86_64-with-glibc2.36 64 Bits Graphics card: Mesa Intel(R) HD Graphics 4600 (HSW GT2) Intel 4.6 (Core Profile) Mesa 22.3.3 **Blender Version** Broken: 3.3.2 Worked: 3.2.2 Caused by 1998269b109f65373336087da7f9751a3c3317f3 **Short description of error** In a specific mesh with two color attributes, and 16 materials, a Color Attribute shading node will suddenly start emitting black **Exact steps for others to reproduce the error** - Open attached file or: - Delete default Cube - Run this script - It will create a cube with two color attributes, one red, one green. The first fifteen material slots are filled with a material that shows the red color attribute, the sixteenth, with one that shows green. Finally the faces are assigned the sixteenth slot. The cube should therefore appear green. ``` import bpy def create_mat(vc): mat = bpy.data.materials.new(f"Mat {vc}") mat.use_nodes = True mat.node_tree.nodes.clear() node_vc = mat.node_tree.nodes.new('ShaderNodeVertexColor') node_out = mat.node_tree.nodes.new('ShaderNodeOutputMaterial') node_vc.layer_name = vc mat.node_tree.links.new(node_vc.outputs[0], node_out.inputs[0]) return mat bpy.ops.mesh.primitive_cube_add() ob = bpy.context.object ob.data.vertex_colors.new(name="Red").data.foreach_set("color", [1,0,0,1]*24) ob.data.vertex_colors.new(name="Green").data.foreach_set("color", [0,1,0,1]*24) mat_red = create_mat("Red") mat_green = create_mat("Green") for _ in range(15): ob.data.materials.append(mat_red) ob.data.materials.append(mat_green) ob.data.polygons.foreach_set('material_index', [15]*6) ``` - Got to material preview mode, - enter edit mode (alternatively, rename the mesh or add a material slot). The cube will suddenly become black. It remains black even if you exit edit mode. To fix it temporarily, exit edit mode, switch to solid shading mode and view the Green color attribute in Attribute mode. Switch back to material preview mode and it will be fixed until you trigger it again. Removing unused material slots fixes it permanently. **Other** This is an extremely weird bug. It's reduced down from a case with many more material slots, all different, and all used (so removing unused slots won't fix it). I couldn't repro without two color attributes and at least 16 material slots. Note that it depends not only the number of slots, but the exact pattern of materials in them. [eevee_attribute__bug.blend](https://archive.blender.org/developer/F14255122/eevee_attribute__bug.blend)
Author
Contributor

Added subscriber: @scurest

Added subscriber: @scurest
Scurest changed title from Color Attribute Shading Node suddently turns black to Color Attribute Shading Node suddently turns black when entering edit mode 2023-02-06 05:02:15 +01:00
Author
Contributor

Narrowed it down to a having first appeared in the 3.3 release.

Narrowed it down to a having first appeared in the 3.3 release.
Germano Cavalcante changed title from Color Attribute Shading Node suddently turns black when entering edit mode to Regression: color attribute is emitted as black on Eevee 2023-02-07 00:15:37 +01:00

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Thank you for the report. I can confirm the bug
I've edited the description to follow the "steps" style a bit more.
In fact it is a regression.

Thank you for the report. I can confirm the bug I've edited the description to follow the "steps" style a bit more. In fact it is a regression.
Member

Caused by 1998269b10

Caused by 1998269b109f65373336087da7f9751a3c3317f3
Member
CC @HooglyBoogly
Philipp Oeser removed the
Interest
Viewport & EEVEE
label 2023-02-09 15:11:51 +01:00
Author
Contributor

Maybe this is obvious from the cause, but I can also repro using eg. float attributes instead of vertex colors.

Maybe this is obvious from the cause, but I can also repro using eg. float attributes instead of vertex colors.
Brecht Van Lommel added this to the 3.5 milestone 2023-02-15 10:26:16 +01:00
Hans Goudey was assigned by Brecht Van Lommel 2023-02-15 10:53:55 +01:00
Brecht Van Lommel added
Type
Bug
and removed
Type
Report
labels 2023-02-15 10:57:48 +01:00
Hans Goudey added this to the Viewport & EEVEE project 2023-02-15 14:46:11 +01:00
Miguel Pozo was assigned by Hans Goudey 2023-02-15 22:17:39 +01:00
Hans Goudey removed their assignment 2023-02-15 22:18:22 +01:00
Blender Bot added the
Status
Resolved
label 2023-02-15 23:55:04 +01:00
Blender Bot removed the
Status
Confirmed
label 2023-02-15 23:55:04 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 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#104370
No description provided.