Page MenuHome

Assign Materials on Faces of an object
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-5.7.6-arch1-1-x86_64-with-glibc2.29 64 Bits
Graphics card: AMD KAVERI (DRM 2.50.0, 5.7.6-arch1-1, LLVM 10.0.0) X.Org 4.5 (Core Profile) Mesa 20.1.2

Blender Version
Broken: version: 2.83.1, branch: makepkg (modified), commit date: 2020-06-25 09:47, hash: rB8289fc688b3e (I've got it from pacman)
Worked: I haven't checked this exact function on other versions so, unknown

Short description of error
Assigning materials on faces of an object breaks the model and doesn't work properly.

Exact steps for others to reproduce the error
My materials:

I've created a sphere with a material 001. Than I've selected certain faces of this sphere and applied material 002 on them:


That's a result of applying the material: faces I've selected disappeared and there is something broken inside. That's what I saw when selected certain faces:

As you can see, this broken black thing changed its shape and colored itself in material 002.

Now then I've selected other rings that were in material 001 previously and assigned and assigned material 003 on them.


Surprisingly, they were colored to material 002

That's what happened when I've assigned material 004 on other selected rings (those rings I've applied the material on are selected in the picture)

Event Timeline

Note: I've tried using version from official site and got the same result

Evan Wilson (EAW) changed the task status from Needs Triage to Needs Information from User.Mon, Jun 29, 3:46 AM

I cannot reproduce the issue using 2.83.1 or 2.90 on Win10.
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 470/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.13


This looks similar to T74024 (see https://developer.blender.org/T74024#922564), which was fixed with rB6d8b6aec1874. That fix only applies to AMD VERDE. @Clément Foucault (fclem), you might have to add another AMD card/driver to the GG.unused_fb_slot_workaround club.

Try starting Blender with --debug --debug-gpu --debug-gpu-force-workarounds to check if the workarounds fix this issue for you. Try both 2.83.1 and 2.90. Please use the versions from
https://builder.blender.org/download/ & https://www.blender.org/download/ so we can continue to eliminate the possibility of it being an unofficial build issue.

Yes, I've tried to do the same thing on the pacman build + official build on Intel GPU machine and wasn't able to reproduce this bug too so that seems like mesa bug.
On AMD machine tho I'm getting the same issue with both 2.83.1 and 2.90 (official build).

I was trying to run Blender 2.83.1 (official build) with

--debug --debug-gpu --debug-gpu-force-workarounds

but it crashed on creating materials this time.
(from blender.crash.txt)

# Blender 2.83.1, Commit date: 2020-06-25 09:47, Hash 8289fc688b3e
bpy.ops.object.select_all(action='SELECT')  # Operator
bpy.ops.object.delete(use_global=False, confirm=False)  # Operator
Deleted 3 object(s)  # Info
bpy.ops.mesh.primitive_uv_sphere_add(radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0))  # Operator
bpy.ops.transform.resize(value=(2.7876, 2.7876, 2.7876), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.context.space_data.context = 'MATERIAL'  # Property
bpy.ops.material.new()  # Operator
bpy.data.materials["Material.001"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.0275943, 0, 0.8, 1)  # Property
bpy.data.materials["Material.001"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.0275943, 0, 0.8, 1)  # Property
bpy.ops.object.material_slot_assign()  # Operator
bpy.ops.object.material_slot_assign()  # Operator
bpy.ops.object.material_slot_assign()  # Operator
bpy.ops.object.material_slot_assign()  # Operator
bpy.ops.object.material_slot_assign()  # Operator
bpy.ops.object.material_slot_assign()  # Operator
bpy.context.space_data.shading.type = 'MATERIAL'  # Property
bpy.ops.object.material_slot_add()  # Operator
bpy.ops.material.new()  # Operator
bpy.data.materials["Material.002"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0, 0.00198925, 0.8, 1)  # Property
bpy.data.materials["Material.002"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0, 0.00198925, 0.8, 1)  # Property

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x698819d]
./blender() [0xc15822]
/usr/lib/libc.so.6(+0x3c3e0) [0x7f2dd77dc3e0]
./blender(GPU_pass_compile+0xb) [0x568d67b]
./blender(GPU_material_compile+0x14) [0x5698644]
./blender() [0x105b819]
./blender(wm_jobs_timer+0xc5) [0xed5725]
./blender(wm_window_process_events+0x1cb) [0xee853b]
./blender(WM_main+0x18) [0xec27f8]
./blender(main+0x311) [0xb4c361]
/usr/lib/libc.so.6(__libc_start_main+0xf2) [0x7f2dd77c7002]
./blender() [0xc11f9c]

Pretty weird, but I've got this crash with creating materials while running --debug-gpu-force-workarounds with with both all official versions (2.83.1 and 2.90) and pacman one. Tho there was one time I was able to run normally with --debug-gpu-workarounds but I haven't recorded logs and all the other times I've tired running it it got crashed like this on all versions.

But it works just with

--debug --debug-gpu

I've attached the logs it gave to this post, there were a lot of warnings from shaders so this may give a clue of what is wrong about this whole situation.

The T74024 bug seems painfully similar to the one I have, so I'll try patching Blender 2.83.1 source code with the following lines:

     *   Radeon HD 7570M;
       *   Radeon HD 7600M;
       * And many others... */

      GG.unused_fb_slot_workaround = true;
      GG.broken_amd_driver = true;
    }
  }

/* AMD KAVERI fix attempt */
  if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) &&
      strstr(renderer, "AMD KAVERI")) {
    GG.unused_fb_slot_workaround = true;
    GG.broken_amd_driver = true;
  }

  if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) {
    if (strstr(renderer, "AMD Radeon Pro") || strstr(renderer, "AMD Radeon R9") ||
        strstr(renderer, "AMD Radeon RX")) {
      GG.depth_blitting_workaround = true;
    }
  }

  if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_OFFICIAL)) {
    /* Limit this fix to older hardware with GL < 4.5. This means Broadwell GPUs are
     * covered since they only support GL 4.4 on windows.
     * This fixes some issues with workbench antialiasing on Win + Intel GPU. (see T76273) */
    if (!GLEW_VERSION_4_5) {
      GG.texture_copy_workaround = true;
    }
  }

But now I'm not sure if that will help at this point.

May be unrelated, but blender 2.90 also just crashes while assigning base color to material (from blender.crash.txt):

# Blender 2.90.0, Commit date: 2020-06-28 15:13, Hash b21ba5e57974
bpy.ops.object.select_all(action='SELECT')  # Operator
bpy.ops.object.delete(use_global=False, confirm=False)  # Operator
Deleted 3 object(s)  # Info
bpy.ops.mesh.primitive_uv_sphere_add(radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))  # Operator
bpy.ops.transform.resize(value=(2.49806, 2.49806, 2.49806), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)  # Operator
bpy.context.space_data.context = 'TEXTURE'  # Property
bpy.ops.texture.new()  # Operator
bpy.context.space_data.context = 'MATERIAL'  # Property
bpy.ops.material.new()  # Operator

# backtrace
./blender(BLI_system_backtrace+0x20) [0x7d011a0]
./blender() [0xccf86a]
/usr/lib/libc.so.6(+0x3c3e0) [0x7f3993cac3e0]
./blender() [0x10c4d77]
./blender(DRW_shgroup_uniform_float_copy+0x25) [0x10c5eb5]
./blender(EEVEE_lightprobes_cache_init+0x14c) [0x10d344c]
./blender(EEVEE_render_cache_init+0x33) [0x10dc8b3]
./blender() [0x10ced2c]
./blender(DRW_render_to_image+0x1ea) [0x10c494a]
./blender(RE_engine_render+0x35c) [0x6465cfc]
./blender() [0x20d3f20]
./blender() [0x20d4309]
./blender() [0x20d46cd]
./blender() [0x20d4904]
./blender() [0xf98122]
/usr/lib/libpthread.so.0(+0x9422) [0x7f39941a1422]
/usr/lib/libc.so.6(clone+0x43) [0x7f3993d6fbf3]

Okay, I've compiled everything and now it works!

What fixed it for me:

source/blender/gpu/intern/gpu_extensions.c

     *   Radeon HD 7570M;
     *   Radeon HD 7600M;
     * And many others... */

    GG.unused_fb_slot_workaround = true;
    GG.broken_amd_driver = true;
  }
}

if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) &&
    strstr(renderer, "AMD VERDE")) {
  /* We have issues with this specific renderer. (see T74024) */
  GG.unused_fb_slot_workaround = true;
  GG.broken_amd_driver = true;
}

if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) &&
    strstr(renderer, "AMD KAVERI")) {
/* AMD KAVERI fix (see T78390) */
  GG.unused_fb_slot_workaround = true;
  GG.broken_amd_driver = true;
}

if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) {
  if (strstr(renderer, "AMD Radeon Pro") || strstr(renderer, "AMD Radeon R9") ||
      strstr(renderer, "AMD Radeon RX")) {
    GG.depth_blitting_workaround = true;
  }
}

Tho everything still crashes when I run Blender with --debug-gpu-force-workarounds but that may be related to another issue(?), I'll leave crash report anyways:

Here's my log from --debug --debug-gpu:

Antifreeze (antifreeze9) closed this task as Resolved.Tue, Jun 30, 6:40 AM
Antifreeze (antifreeze9) claimed this task.