[Bf-blender-cvs] [ba982119cdc] master: Workbench Next

Miguel Pozo noreply at git.blender.org
Mon Jan 23 17:59:10 CET 2023


Commit: ba982119cdcacfa8e603457face1d8ebc763ef75
Author: Miguel Pozo
Date:   Mon Jan 23 17:59:07 2023 +0100
Branches: master
https://developer.blender.org/rBba982119cdcacfa8e603457face1d8ebc763ef75

Workbench Next

Rewrite of the Workbench engine using C++ and the new Draw Manager API.

The new engine can be enabled in Blender `Preferences > Experimental > Workbench Next`.
After that, the engine can be selected in `Properties > Scene > Render Engine`.
When `Workbench Next` is the active engine, it also handles the `Solid` viewport mode rendering.

The rewrite aims to be functionally equivalent to the current Workbench engine, but it also includes some small fixes/tweaks:
- `In Front` rendered objects now work correctly with DoF and Shadows.
- The `Sampling > Viewport` setting is actually used when the viewport is in `Render Mode`.
- In `Texture` mode, textured materials also use the material properties. (Previously, only non textured materials would)

To do:
- Sculpt PBVH.
- Volume rendering.
- Hair rendering.
- Use the "no_geom" shader versions for shadow rendering.
- Decide the final API for custom visibility culling (Needed for shadows).
- Profile/optimize.

Known Issues:
- Matcaps are not loaded until they’re shown elsewhere. (e.g. when opening the `Viewort Shading` UI)
- Outlines are drawn between different materials of the same object. (Each material submesh has its own object handle)

Reviewed By: fclem

Maniphest Tasks: T101619

Differential Revision: https://developer.blender.org/D16826

===================================================================

M	release/scripts/startup/bl_ui/properties_data_armature.py
M	release/scripts/startup/bl_ui/properties_data_bone.py
M	release/scripts/startup/bl_ui/properties_data_camera.py
M	release/scripts/startup/bl_ui/properties_data_curve.py
M	release/scripts/startup/bl_ui/properties_data_curves.py
M	release/scripts/startup/bl_ui/properties_data_lattice.py
M	release/scripts/startup/bl_ui/properties_data_light.py
M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	release/scripts/startup/bl_ui/properties_data_metaball.py
M	release/scripts/startup/bl_ui/properties_data_pointcloud.py
M	release/scripts/startup/bl_ui/properties_data_speaker.py
M	release/scripts/startup/bl_ui/properties_data_volume.py
M	release/scripts/startup/bl_ui/properties_freestyle.py
M	release/scripts/startup/bl_ui/properties_material.py
M	release/scripts/startup/bl_ui/properties_material_gpencil.py
M	release/scripts/startup/bl_ui/properties_object.py
M	release/scripts/startup/bl_ui/properties_output.py
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	release/scripts/startup/bl_ui/properties_physics_common.py
M	release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
M	release/scripts/startup/bl_ui/properties_physics_field.py
M	release/scripts/startup/bl_ui/properties_physics_fluid.py
M	release/scripts/startup/bl_ui/properties_physics_rigidbody.py
M	release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
M	release/scripts/startup/bl_ui/properties_physics_softbody.py
M	release/scripts/startup/bl_ui/properties_render.py
M	release/scripts/startup/bl_ui/properties_texture.py
M	release/scripts/startup/bl_ui/properties_view_layer.py
M	release/scripts/startup/bl_ui/properties_world.py
M	release/scripts/startup/bl_ui/space_node.py
M	release/scripts/startup/bl_ui/space_sequencer.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/blenkernel/intern/scene.cc
M	source/blender/draw/CMakeLists.txt
M	source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh
M	source/blender/draw/engines/workbench/shaders/infos/workbench_effect_cavity_info.hh
M	source/blender/draw/engines/workbench/shaders/infos/workbench_effect_outline_info.hh
M	source/blender/draw/engines/workbench/shaders/infos/workbench_merge_infront_info.hh
M	source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh
M	source/blender/draw/engines/workbench/shaders/infos/workbench_shadow_info.hh
M	source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_curvature_lib.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_matcap_lib.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_material_lib.glsl
A	source/blender/draw/engines/workbench/shaders/workbench_next_composite_frag.glsl
A	source/blender/draw/engines/workbench/shaders/workbench_next_merge_depth_frag.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_shadow_vert.glsl
A	source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl
A	source/blender/draw/engines/workbench/workbench_defines.hh
A	source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc
A	source/blender/draw/engines/workbench/workbench_effect_cavity.cc
A	source/blender/draw/engines/workbench/workbench_effect_dof.cc
A	source/blender/draw/engines/workbench/workbench_effect_outline.cc
A	source/blender/draw/engines/workbench/workbench_engine.cc
M	source/blender/draw/engines/workbench/workbench_engine.h
A	source/blender/draw/engines/workbench/workbench_enums.hh
A	source/blender/draw/engines/workbench/workbench_materials_next.cc
A	source/blender/draw/engines/workbench/workbench_mesh_passes.cc
M	source/blender/draw/engines/workbench/workbench_private.h
A	source/blender/draw/engines/workbench/workbench_private.hh
A	source/blender/draw/engines/workbench/workbench_resources.cc
A	source/blender/draw/engines/workbench/workbench_shader_cache.cc
M	source/blender/draw/engines/workbench/workbench_shader_shared.h
A	source/blender/draw/engines/workbench/workbench_shadow.cc
A	source/blender/draw/engines/workbench/workbench_state.cc
M	source/blender/draw/intern/DRW_gpu_wrapper.hh
M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager.cc
M	source/blender/draw/intern/draw_pass.hh
M	source/blender/draw/intern/draw_view.cc
M	source/blender/draw/intern/draw_view.hh
M	source/blender/draw/intern/shaders/draw_view_info.hh
M	source/blender/draw/intern/smaa_textures.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/space_view3d/view3d_utils.c
M	source/blender/gpu/CMakeLists.txt
M	source/blender/gpu/intern/gpu_texture_private.hh
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index d1a6c0165e0..aefcb53fb56 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -248,7 +248,7 @@ class DATA_PT_motion_paths_display(MotionPathButtonsPanel_display, Panel):
 
 
 class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
     _context_path = "object.data"
     _property_type = bpy.types.Armature
 
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index 14f6da83be2..465a1854528 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -444,7 +444,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
 
 
 class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
     _property_type = bpy.types.Bone, bpy.types.EditBone, bpy.types.PoseBone
 
     @property
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index 0a9a16999b8..6ecfa9dfbb4 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -21,7 +21,7 @@ class CAMERA_PT_presets(PresetPanel, Panel):
     preset_subdir = "camera"
     preset_operator = "script.execute_preset"
     preset_add_operator = "camera.preset_add"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
 
 class CAMERA_PT_safe_areas_presets(PresetPanel, Panel):
@@ -29,13 +29,13 @@ class CAMERA_PT_safe_areas_presets(PresetPanel, Panel):
     preset_subdir = "safe_areas"
     preset_operator = "script.execute_preset"
     preset_add_operator = "camera.safe_areas_preset_add"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH', 'BLENDER_WORKBENCH_NEXT'}
 
 
 class DATA_PT_context_camera(CameraButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -52,7 +52,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel):
 
 class DATA_PT_lens(CameraButtonsPanel, Panel):
     bl_label = "Lens"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -100,7 +100,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
                     col.prop(ccam, "fisheye_polynomial_k3", text="K3")
                     col.prop(ccam, "fisheye_polynomial_k4", text="K4")
 
-            elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}:
+            elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}:
                 if cam.lens_unit == 'MILLIMETERS':
                     col.prop(cam, "lens")
                 elif cam.lens_unit == 'FOV':
@@ -122,7 +122,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
 
 class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
     bl_label = "Stereoscopy"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     @classmethod
     def poll(cls, context):
@@ -171,7 +171,7 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
 class DATA_PT_camera(CameraButtonsPanel, Panel):
     bl_label = "Camera"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw_header_preset(self, _context):
         CAMERA_PT_presets.draw_panel_header(self.layout)
@@ -201,7 +201,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
 class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
     bl_label = "Depth of Field"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw_header(self, context):
         cam = context.camera
@@ -228,7 +228,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
 class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel):
     bl_label = "Aperture"
     bl_parent_id = "DATA_PT_camera_dof"
-    COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -252,7 +252,7 @@ class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel):
 class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
     bl_label = "Background Images"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw_header(self, context):
         cam = context.camera
@@ -359,7 +359,7 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
 class DATA_PT_camera_display(CameraButtonsPanel, Panel):
     bl_label = "Viewport Display"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -392,7 +392,7 @@ class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
     bl_label = "Composition Guides"
     bl_parent_id = "DATA_PT_camera_display"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -419,7 +419,7 @@ class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
 class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
     bl_label = "Safe Areas"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw_header(self, context):
         cam = context.camera
@@ -449,7 +449,7 @@ class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel):
     bl_label = "Center-Cut Safe Areas"
     bl_parent_id = "DATA_PT_camera_safe_areas"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw_header(self, context):
         cam = context.camera
@@ -473,7 +473,7 @@ class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel):
 
 
 class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
     _context_path = "object.data"
     _property_type = bpy.types.Camera
 
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 88dd3caaa74..fc02d15d267 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -116,7 +116,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
 class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
     bl_label = "Texture Space"
     bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
 
     def draw(self, context):
         layout = self.layout
@@ -475,7 +475,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
 
 
 class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'}
     _context_path = "object.data"
     _property_type

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list