Page MenuHome

EEVEE: add support for material override.
Needs RevisionPublic

Authored by Jean Da Costa (jeacom256) on Oct 7 2020, 8:20 PM.

Details

Summary

Okay, while working on D9130 I discovered that eevee seems to already support material override out of the box with no major changes to the code.

It was so simple that made me suspicious, I hope I am not missing something catastrophic.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D9143_1 (branched from master)
Build Status
Buildable 10687
Build 10687: arc lint + arc unit

Event Timeline

Jean Da Costa (jeacom256) requested review of this revision.Oct 7 2020, 8:20 PM
Jean Da Costa (jeacom256) created this revision.

is there any way we can overide the vertex shader in a material- but keep the fragment?

for things like GPU armature skinning or ???

update patch with arcanist to make code context visible.

Clément Foucault (fclem) requested changes to this revision.Oct 12 2020, 2:00 PM

Please apply clang-format for your patch. Appart from that and the naming convention I see no problem with this patch.

release/scripts/startup/bl_ui/properties_view_layer.py
153

Rename to VIEWLAYER_PT_eevee_layer_override since we might have other optinos later in the future.

This revision now requires changes to proceed.Oct 12 2020, 2:00 PM
  • formating
  • rename VIEWLAYER_PT_eevee_material_override to VIEWLAYER_PT_eevee_layer_override
Jeroen Bakker (jbakker) requested changes to this revision.Oct 20 2020, 3:48 PM

Material Override setting also allows to choose grease pencil materials. We should limit this.

Use https://cloud.blender.org/p/gallery/5dd6d7044441651fa3decb56
when setting the material override to Body material crashes blender:

b291(BLI_system_backtrace+0x39) [0xdf36b8a]
b291(_BLI_assert_print_backtrace+0x1a) [0xde0c688]
b291(CustomData_get_layer_index_n+0x21) [0x371188f]
b291(BKE_mesh_calc_loop_tangent_ex+0x7b0) [0x376dbba]
b291() [0x3b6b014]
b291() [0x3b6bb31]
b291() [0x3b7ef6b]
b291() [0x3b7f36d]
b291() [0xdf38191]
b291() [0xdf3b212]
b291() [0x3787105]
b291() [0xdf39209]
b291() [0xdf38782]
b291() [0xdf381c8]
b291() [0xdf3c314]
b291() [0xdf3c14b]
b291() [0xdf3be98]
b291() [0xdf3b817]
b291() [0xdf3b242]
b291() [0xdf3b925]
b291() [0xdf3c728]
b291() [0x3794805]
b291() [0x3794abb]
b291() [0x33e93d3]
b291() [0x33e98bd]
b291() [0x33edc52]
b291() [0x3787fc2]
b291() [0x33eb24c]
b291() [0x33ea15f]
b291() [0x33e992f]
b291(BLI_task_graph_work_and_wait+0x1c) [0xdf37059]
b291(DRW_mesh_batch_cache_create_requested+0x49eb) [0x3b31149]
b291(drw_batch_cache_generate_requested+0x142) [0x3b1a915]
b291() [0x3a9e2b2]
b291(DRW_draw_render_loop_ex+0x454) [0x3a9f908]
b291(DRW_draw_view+0x177) [0x3a9f458]
b291() [0x47fe15d]
b291(view3d_main_region_draw+0x47) [0x47fe20c]
b291(ED_region_do_draw+0x1a5) [0x40ddcff]
b291() [0x379caf9]
b291() [0x379d0bb]
b291(wm_draw_update+0xc9) [0x379d707]
b291(WM_main+0x4c) [0x3799fb0]
b291() [0x3322a8c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7ff2153590b3]
b291(_start+0x2e) [0x332245e]
BLI_assert failed: /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/customdata.c:2288, CustomData_get_layer_index_n(), at 'n >= 0'
Aborted (core dumped)
release/scripts/startup/bl_ui/properties_view_layer.py
144

perhaps add

layout.use_property_split = True
layout.use_property_decorate = False

for a better UI/UX

source/blender/draw/engines/eevee/eevee_materials.c
684

If an object is selected for holdout and material overrides are added, the hold out is also overridden. I think this is not what users expect.

This revision now requires changes to proceed.Oct 20 2020, 3:48 PM