EEVEE-Next: New shadow settings #113980

Merged
Miguel Pozo merged 20 commits from pragma37/blender:pull-eevee-shadow-settings into main 2023-11-06 15:45:10 +01:00
Member

Remove Material > Shadow Mode and use Object > Shadow Ray Visibility and Material > Transparent Shadows instead.
The versioning system auto-updates objects/materials in EEVEE scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native use_transparent_shadow property.

Material changes don't set any recalc flag on the objects that use them, so the EEVEE Next shadow maps don't update when changing settings/nodes. Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility` and `Material > Transparent Shadows` instead. The versioning system auto-updates objects/materials in EEVEE scenes so their behavior is as close as possible to the previous one. Update Cycles to use the native `use_transparent_shadow` property. Material changes don't set any `recalc` flag on the objects that use them, so the EEVEE Next shadow maps don't update when changing settings/nodes. Fixing this issue is required for 4.1, but it's out of the scope of this PR.
Miguel Pozo added the
Interest
EEVEE
Module
EEVEE & Viewport
labels 2023-10-20 20:36:06 +02:00
Miguel Pozo added 8 commits 2023-10-20 20:36:21 +02:00

However, there's not a good way to do so without misconfiguring existing either EEVEE-only or Cycles-only scenes.

We had this problem before. The guideline is to use Cycles property if Cycles is the set as renderer and use EEVEE property otherwise.

> However, there's not a good way to do so without misconfiguring existing either EEVEE-only or Cycles-only scenes. We had this problem before. The guideline is to use Cycles property if Cycles is the set as renderer and use EEVEE property otherwise.
Miguel Pozo added 2 commits 2023-10-23 19:04:02 +02:00
Miguel Pozo changed title from WIP: EEVEE-Next: New shadow settings to EEVEE-Next: New shadow settings 2023-10-23 19:48:57 +02:00
Miguel Pozo added 1 commit 2023-10-23 19:59:27 +02:00
Miguel Pozo requested review from Clément Foucault 2023-10-23 20:00:31 +02:00
Clément Foucault requested changes 2023-10-30 15:29:20 +01:00
Clément Foucault left a comment
Member

I think it is important to do the unification with cycles before this lands.

I think it is important to do the unification with cycles before this lands.
@ -393,0 +393,4 @@
if ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'CURVES', 'POINTCLOUD', 'VOLUME'}:
layout.separator()
col = layout.column(heading="Ray Visibility")
col.prop(ob, "visible_shadow", text="Shadow", toggle=False)

Use hide_shadow for consistency with the other visibility options for now.

Use `hide_shadow` for consistency with the other visibility options for now.
Author
Member

I think having 2 different Python properties that change the same flag is going to be quite confusing for Python users.

I think having 2 different Python properties that change the same flag is going to be quite confusing for Python users.

Nevermind, I replied to this before we decided to unify the setting first. So use cycles naming convention for now. We can still create an alias if we decide to port it later.

I think having 2 different Python properties that change the same flag is going to be quite confusing for Python users.

We can do that for compatibility reasons.

Nevermind, I replied to this before we decided to unify the setting first. So use cycles naming convention for now. We can still create an alias if we decide to port it later. > I think having 2 different Python properties that change the same flag is going to be quite confusing for Python users. We can do that for compatibility reasons.
fclem marked this conversation as resolved
Miguel Pozo added 2 commits 2023-10-30 17:32:50 +01:00
Miguel Pozo added the
Interest
Cycles
label 2023-10-30 17:34:33 +01:00
Miguel Pozo requested review from Brecht Van Lommel 2023-10-30 17:34:48 +01:00
Miguel Pozo added 1 commit 2023-10-30 17:37:01 +01:00
Clément Foucault approved these changes 2023-10-30 20:09:38 +01:00
@ -245,0 +277,4 @@
hide_shadows = false;
}
if (material) {
if (material->blend_shadow == MA_BS_SOLID) {

We have SET_FLAG_FROM_TEST.

We have `SET_FLAG_FROM_TEST`.
pragma37 marked this conversation as resolved
Miguel Pozo added 1 commit 2023-10-31 20:27:12 +01:00
Brecht Van Lommel requested changes 2023-11-03 18:19:19 +01:00
@ -245,0 +251,4 @@
* and the Material::blend_flag for transparent shadows.
*/
if (!ELEM(object->type,

I don't think this type check is really needed. If the object has materials it can be done.

I don't think this type check is really needed. If the object has materials it can be done.
pragma37 marked this conversation as resolved
@ -245,0 +278,4 @@
}
if (material) {
bool transparent_shadow = material->blend_shadow != MA_BS_SOLID;
SET_FLAG_FROM_TEST(material->blend_flag, transparent_shadow, MA_BL_TRANSPARENT_SHADOW);

This seems like the wrong place to do this, should be in the loop over bmain->materials? Otherwise unused materials are not updated.

This seems like the wrong place to do this, should be in the loop over `bmain->materials`? Otherwise unused materials are not updated.
pragma37 marked this conversation as resolved
@ -319,0 +376,4 @@
if (!STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE)) {
continue;
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (scene->master_collection, object) {

I think this should only look at the first scene as we do in other versioning, not iterate over collections.

It's not ideal, but I don't really trust recursively iterating over collections in the versioning code.

I think this should only look at the first scene as we do in other versioning, not iterate over collections. It's not ideal, but I don't really trust recursively iterating over collections in the versioning code.
pragma37 marked this conversation as resolved
Miguel Pozo added 1 commit 2023-11-03 19:23:21 +01:00
Miguel Pozo added 1 commit 2023-11-03 19:28:00 +01:00
Miguel Pozo requested review from Brecht Van Lommel 2023-11-03 19:30:22 +01:00
Brecht Van Lommel approved these changes 2023-11-06 10:07:01 +01:00
@ -1786,0 +1826,4 @@
bool is_cycles = scene && STREQ(scene->r.engine, RE_engine_id_CYCLES);
if (is_cycles) {
const Material &default_mat = *DNA_struct_default_get(Material);
const bool default_transparent_shadows = default_mat.blend_flag & MA_BL_TRANSPARENT_SHADOW;

I'm not really sure what the purpose is of this logic. Why not just set this to true? The previous Cycles default does not depend on this DNA default.

I'm not really sure what the purpose is of this logic. Why not just set this to `true`? The previous Cycles default does not depend on this DNA default.
pragma37 marked this conversation as resolved
Miguel Pozo added 1 commit 2023-11-06 15:39:06 +01:00
Miguel Pozo added 2 commits 2023-11-06 15:43:02 +01:00
Miguel Pozo merged commit 6d0b5e2ace into main 2023-11-06 15:45:10 +01:00
Miguel Pozo deleted branch pull-eevee-shadow-settings 2023-11-06 15:45:12 +01:00
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
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#113980
No description provided.