T55454: removal of clay engine

The ClayEngine was introduced to test the blender2.8 architecture during
development. As currently we have the wanted features implemented with
matcaps we are going to remove the clay engine as it was never intended
to be an official releasable engine

Note: The test cases are never run. But when enabled will be skipped as
they were implemented over the Clay Engine
This commit is contained in:
Jeroen Bakker 2018-06-12 15:15:36 +02:00
parent d72ddb81ae
commit b6b1e0f56c
73 changed files with 114 additions and 2086 deletions

View File

@ -227,8 +227,6 @@ option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported
mark_as_advanced(WITH_SYSTEM_BULLET)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)

View File

@ -1,3 +0,0 @@
These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -328,7 +328,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from
class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Armature

View File

@ -402,7 +402,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_property_type = bpy.types.Bone, bpy.types.EditBone, bpy.types.PoseBone
@property

View File

@ -37,7 +37,7 @@ class CAMERA_MT_presets(Menu):
bl_label = "Camera Presets"
preset_subdir = "camera"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
draw = Menu.draw_preset
@ -45,14 +45,14 @@ class SAFE_AREAS_MT_presets(Menu):
bl_label = "Camera Presets"
preset_subdir = "safe_areas"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
draw = Menu.draw_preset
class DATA_PT_context_camera(CameraButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -72,7 +72,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel):
class DATA_PT_lens(CameraButtonsPanel, Panel):
bl_label = "Lens"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -113,7 +113,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
sub = col.column(align=True)
sub.prop(ccam, "longitude_min", text="Longiture Min")
sub.prop(ccam, "longitude_max", text="Max")
elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}:
elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE'}:
if cam.lens_unit == 'MILLIMETERS':
col.prop(cam, "lens")
elif cam.lens_unit == 'FOV':
@ -135,7 +135,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
bl_label = "Stereoscopy"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -183,7 +183,7 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
class DATA_PT_camera(CameraButtonsPanel, Panel):
bl_label = "Camera"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -216,7 +216,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_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -235,7 +235,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_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -269,7 +269,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_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw_header(self, context):
cam = context.camera
@ -370,7 +370,7 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
bl_label = "Display"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -403,7 +403,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
bl_label = "Safe Areas"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw_header(self, context):
cam = context.camera
@ -419,7 +419,7 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Camera

View File

@ -135,7 +135,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_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -459,7 +459,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Curve

View File

@ -26,7 +26,7 @@ class LAMP_MT_sunsky_presets(Menu):
bl_label = "Sun & Sky Presets"
preset_subdir = "sunsky"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
draw = Menu.draw_preset
@ -44,7 +44,7 @@ class DataButtonsPanel:
class DATA_PT_context_lamp(DataButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -63,7 +63,7 @@ class DATA_PT_context_lamp(DataButtonsPanel, Panel):
class DATA_PT_preview(DataButtonsPanel, Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
self.layout.template_preview(context.lamp)
@ -71,7 +71,7 @@ class DATA_PT_preview(DataButtonsPanel, Panel):
class DATA_PT_lamp(DataButtonsPanel, Panel):
bl_label = "Lamp"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
@ -243,7 +243,7 @@ class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
class DATA_PT_area(DataButtonsPanel, Panel):
bl_label = "Area Shape"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
@ -269,7 +269,7 @@ class DATA_PT_area(DataButtonsPanel, Panel):
class DATA_PT_spot(DataButtonsPanel, Panel):
bl_label = "Spot Shape"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
@ -330,7 +330,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
bl_label = "Falloff Curve"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -346,7 +346,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Lamp

View File

@ -85,7 +85,7 @@ class DATA_PT_lattice(DataButtonsPanel, Panel):
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Lattice

View File

@ -35,7 +35,7 @@ class DataButtonsPanel:
class DATA_PT_context_lightprobe(DataButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -52,7 +52,7 @@ class DATA_PT_context_lightprobe(DataButtonsPanel, Panel):
class DATA_PT_lightprobe(DataButtonsPanel, Panel):
bl_label = "Probe"
COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -114,7 +114,7 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
bl_label = "Custom Parallax"
COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -144,7 +144,7 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
bl_label = "Display"
COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout

View File

@ -24,7 +24,7 @@ from rna_prop_ui import PropertyPanel
class MESH_MT_vertex_group_specials(Menu):
bl_label = "Vertex Group Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -48,7 +48,7 @@ class MESH_MT_vertex_group_specials(Menu):
class MESH_MT_shape_key_specials(Menu):
bl_label = "Shape Key Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -137,7 +137,7 @@ class MeshButtonsPanel:
class DATA_PT_context_mesh(MeshButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -154,7 +154,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel):
class DATA_PT_normals(MeshButtonsPanel, Panel):
bl_label = "Normals"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -174,7 +174,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
bl_label = "Texture Space"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -194,7 +194,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
bl_label = "Vertex Groups"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -283,7 +283,7 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel):
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
bl_label = "Shape Keys"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -376,7 +376,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
bl_label = "UV Maps"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -395,7 +395,7 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
class DATA_PT_vertex_colors(MeshButtonsPanel, Panel):
bl_label = "Vertex Colors"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -415,7 +415,7 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, Panel):
class DATA_PT_customdata(MeshButtonsPanel, Panel):
bl_label = "Geometry Data"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -441,7 +441,7 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel):
class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Mesh

View File

@ -71,7 +71,7 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
bl_label = "Texture Space"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -125,7 +125,7 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.MetaBall

View File

@ -36,7 +36,7 @@ class DataButtonsPanel:
class DATA_PT_context_speaker(DataButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -55,7 +55,7 @@ class DATA_PT_context_speaker(DataButtonsPanel, Panel):
class DATA_PT_speaker(DataButtonsPanel, Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -76,7 +76,7 @@ class DATA_PT_speaker(DataButtonsPanel, Panel):
class DATA_PT_distance(DataButtonsPanel, Panel):
bl_label = "Distance"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -99,7 +99,7 @@ class DATA_PT_distance(DataButtonsPanel, Panel):
class DATA_PT_cone(DataButtonsPanel, Panel):
bl_label = "Cone"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -121,7 +121,7 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Speaker

View File

@ -352,7 +352,7 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit fr
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object"
_property_type = bpy.types.Object

View File

@ -66,7 +66,7 @@ def particle_get_settings(context):
class PARTICLE_MT_specials(Menu):
bl_label = "Particle Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -86,7 +86,7 @@ class PARTICLE_MT_hair_dynamics_presets(Menu):
bl_label = "Hair Dynamics Presets"
preset_subdir = "hair_dynamics"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
draw = Menu.draw_preset
@ -131,7 +131,7 @@ class PARTICLE_UL_particle_systems(bpy.types.UIList):
class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -234,7 +234,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
bl_label = "Emission"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -286,7 +286,7 @@ class PARTICLE_PT_emission_source(ParticleButtonsPanel, Panel):
bl_label = "Source"
bl_parent_id = "PARTICLE_PT_emission"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -324,7 +324,7 @@ class PARTICLE_PT_emission_source(ParticleButtonsPanel, Panel):
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
bl_label = "Hair Dynamics"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -400,7 +400,7 @@ class PARTICLE_PT_hair_dynamics_structure(ParticleButtonsPanel, Panel):
bl_label = "Structure"
bl_parent_id = "PARTICLE_PT_hair_dynamics"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -432,7 +432,7 @@ class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel):
bl_label = "Volume"
bl_parent_id = "PARTICLE_PT_hair_dynamics"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -464,7 +464,7 @@ class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel):
class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
bl_label = "Cache"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -494,7 +494,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
bl_label = "Velocity"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -543,7 +543,7 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
bl_label = "Rotation"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -596,7 +596,7 @@ class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel):
bl_label = "Angular Velocity"
bl_parent_id = "PARTICLE_PT_rotation"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -620,7 +620,7 @@ class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel):
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -818,7 +818,7 @@ class PARTICLE_PT_physics_deflection(ParticleButtonsPanel, Panel):
bl_label = "Deflection"
bl_parent_id = "PARTICLE_PT_physics"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -844,7 +844,7 @@ class PARTICLE_PT_physics_deflection(ParticleButtonsPanel, Panel):
class PARTICLE_PT_physics_forces(ParticleButtonsPanel, Panel):
bl_label = "Forces"
bl_parent_id = "PARTICLE_PT_physics"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -871,7 +871,7 @@ class PARTICLE_PT_physics_integration(ParticleButtonsPanel, Panel):
bl_label = "Integration"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = "PARTICLE_PT_physics"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -903,7 +903,7 @@ class PARTICLE_PT_physics_integration(ParticleButtonsPanel, Panel):
class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
bl_label = "Boid Brain"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1006,7 +1006,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
bl_label = "Render"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1046,7 +1046,7 @@ class PARTICLE_PT_render_extra(ParticleButtonsPanel, Panel):
bl_label = "Extra"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1073,7 +1073,7 @@ class PARTICLE_PT_render_line(ParticleButtonsPanel, Panel):
bl_label = "Line"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1101,7 +1101,7 @@ class PARTICLE_PT_render_path(ParticleButtonsPanel, Panel):
bl_label = "Path"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1136,7 +1136,7 @@ class PARTICLE_PT_render_path_timing(ParticleButtonsPanel, Panel):
bl_label = "Timing"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1168,7 +1168,7 @@ class PARTICLE_PT_render_object(ParticleButtonsPanel, Panel):
bl_label = "Object"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1196,7 +1196,7 @@ class PARTICLE_PT_render_collection(ParticleButtonsPanel, Panel):
bl_label = "Collection"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1228,7 +1228,7 @@ class PARTICLE_PT_render_collection_use_count(ParticleButtonsPanel, Panel):
bl_label = "Use Count"
bl_parent_id = "PARTICLE_PT_render_collection"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1277,7 +1277,7 @@ class PARTICLE_PT_render_billboards_alignment(ParticleButtonsPanel, Panel):
bl_label = "Billboard Alignment"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1303,7 +1303,7 @@ class PARTICLE_PT_render_billboards_tilt(ParticleButtonsPanel, Panel):
bl_label = "Billboard Tilt"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1337,7 +1337,7 @@ class PARTICLE_PT_render_billboards_uv(ParticleButtonsPanel, Panel):
bl_label = "Billboard UVs"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1373,7 +1373,7 @@ class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel):
bl_label = "Trails"
bl_parent_id = "PARTICLE_PT_render"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1401,7 +1401,7 @@ class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel):
class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1463,7 +1463,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
bl_label = "Children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1519,7 +1519,7 @@ class PARTICLE_PT_children_parting(ParticleButtonsPanel, Panel):
bl_label = "Parting"
bl_parent_id = "PARTICLE_PT_children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1544,7 +1544,7 @@ class PARTICLE_PT_children_clumping(ParticleButtonsPanel, Panel):
bl_label = "Clumping"
bl_parent_id = "PARTICLE_PT_children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1586,7 +1586,7 @@ class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
bl_label = "Roughness"
bl_parent_id = "PARTICLE_PT_children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1628,7 +1628,7 @@ class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel):
bl_label = "Kink"
bl_parent_id = "PARTICLE_PT_children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1679,7 +1679,7 @@ class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel):
class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel):
bl_label = "Field Weights"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1700,7 +1700,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel):
class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel):
bl_label = "Force Field Settings"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -1734,7 +1734,7 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel):
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
bl_label = "Vertex Groups"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1807,7 +1807,7 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
class PARTICLE_PT_textures(ParticleButtonsPanel, Panel):
bl_label = "Textures"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1839,7 +1839,7 @@ class PARTICLE_PT_textures(ParticleButtonsPanel, Panel):
class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel):
bl_label = "Hair Shape"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -1866,7 +1866,7 @@ class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel):
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "particle_system.settings"
_property_type = bpy.types.ParticleSettings

View File

@ -38,7 +38,7 @@ class PhysicButtonsPanel:
class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
bl_label = "Force Fields"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -175,7 +175,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
bl_label = "Collision"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):

View File

@ -391,7 +391,7 @@ class RENDER_UL_renderviews(UIList):
class RENDER_PT_stereoscopy(RenderButtonsPanel, Panel):
bl_label = "Stereoscopy"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
@ -432,28 +432,6 @@ class RENDER_PT_stereoscopy(RenderButtonsPanel, Panel):
row.prop(rv, "camera_suffix", text="")
class RENDER_PT_clay_settings(RenderButtonsPanel, Panel):
bl_label = "Clay Settings"
COMPAT_ENGINES = {'BLENDER_CLAY'}
def draw(self, context):
layout = self.layout
props = context.scene.display
col = layout.column()
col.template_icon_view(props, "matcap_icon")
col.prop(props, "matcap_rotation")
col.prop(props, "matcap_hue")
col.prop(props, "matcap_saturation")
col.prop(props, "matcap_value")
col.prop(props, "matcap_ssao_samples")
col.prop(props, "matcap_ssao_factor_cavity")
col.prop(props, "matcap_ssao_factor_edge")
col.prop(props, "matcap_ssao_distance")
col.prop(props, "matcap_ssao_attenuation")
col.prop(props, "matcap_hair_brightness_randomness")
class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
bl_label = "Ambient Occlusion"
bl_options = {'DEFAULT_CLOSED'}
@ -796,7 +774,6 @@ classes = (
RENDER_UL_renderviews,
RENDER_PT_stereoscopy,
RENDER_PT_hair,
RENDER_PT_clay_settings,
RENDER_PT_eevee_sampling,
RENDER_PT_eevee_film,
RENDER_PT_eevee_shadows,

View File

@ -65,7 +65,7 @@ class SceneButtonsPanel:
class SCENE_PT_scene(SceneButtonsPanel, Panel):
bl_label = "Scene"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -79,7 +79,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
class SCENE_PT_unit(SceneButtonsPanel, Panel):
bl_label = "Units"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -161,7 +161,7 @@ class SceneKeyingSetsPanel:
class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Keying Sets"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -195,7 +195,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Active Keying Set"
bl_parent_id = "SCENE_PT_keying_sets"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
@ -252,7 +252,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
class SCENE_PT_color_management(SceneButtonsPanel, Panel):
bl_label = "Color Management"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -278,7 +278,7 @@ class SCENE_PT_color_management_curves(SceneButtonsPanel, Panel):
bl_label = "Use Curves"
bl_parent_id = "SCENE_PT_color_management"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw_header(self, context):
@ -302,7 +302,7 @@ class SCENE_PT_color_management_curves(SceneButtonsPanel, Panel):
class SCENE_PT_audio(SceneButtonsPanel, Panel):
bl_label = "Audio"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@ -434,7 +434,7 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
class SCENE_PT_simplify(SceneButtonsPanel, Panel):
bl_label = "Simplify"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw_header(self, context):
rd = context.scene.render
@ -495,7 +495,7 @@ class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel):
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "scene"
_property_type = bpy.types.Scene

View File

@ -34,7 +34,7 @@ class ViewLayerButtonsPanel:
class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel):
bl_label = "View Layer"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout

View File

@ -110,7 +110,6 @@
#include "bmesh.h"
const char *RE_engine_id_BLENDER_CLAY = "BLENDER_CLAY";
const char *RE_engine_id_BLENDER_EEVEE = "BLENDER_EEVEE";
const char *RE_engine_id_BLENDER_WORKBENCH = "BLENDER_WORKBENCH";
const char *RE_engine_id_CYCLES = "CYCLES";
@ -808,15 +807,8 @@ void BKE_scene_init(Scene *sce)
copy_v3_v3(sce->display.light_direction, (float[3]){-M_SQRT1_3, -M_SQRT1_3, M_SQRT1_3});
sce->display.shadow_shift = 0.1;
sce->display.matcap_icon = 1;
sce->display.matcap_type = CLAY_MATCAP_NONE;
sce->display.matcap_hue = 0.5f;
sce->display.matcap_saturation = 0.5f;
sce->display.matcap_value = 0.5f;
sce->display.matcap_ssao_distance = 0.2f;
sce->display.matcap_ssao_attenuation = 1.0f;
sce->display.matcap_ssao_factor_cavity = 1.0f;
sce->display.matcap_ssao_factor_edge = 1.0f;
sce->display.matcap_ssao_samples = 16;
/* SceneEEVEE */

View File

@ -82,10 +82,6 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_CLAY_ENGINE)
add_definitions(-DWITH_CLAY_ENGINE)
endif()
if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()

View File

@ -1444,15 +1444,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) {
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->display.matcap_icon = 1;
scene->display.matcap_type = CLAY_MATCAP_NONE;
scene->display.matcap_hue = 0.5f;
scene->display.matcap_saturation = 0.5f;
scene->display.matcap_value = 0.5f;
scene->display.matcap_ssao_distance = 0.2f;
scene->display.matcap_ssao_attenuation = 1.0f;
scene->display.matcap_ssao_factor_cavity = 1.0f;
scene->display.matcap_ssao_factor_edge = 1.0f;
scene->display.matcap_ssao_samples = 16;
}

View File

@ -91,7 +91,6 @@ set(SRC
modes/pose_mode.c
modes/sculpt_mode.c
engines/basic/basic_engine.c
engines/clay/clay_engine.c
engines/eevee/eevee_bloom.c
engines/eevee/eevee_data.c
engines/eevee/eevee_depth_of_field.c
@ -134,27 +133,12 @@ set(SRC
modes/draw_mode_engines.h
modes/edit_mesh_mode_intern.h
engines/basic/basic_engine.h
engines/clay/clay_engine.h
engines/eevee/eevee_engine.h
engines/eevee/eevee_lut.h
engines/eevee/eevee_private.h
engines/external/external_engine.h
)
if(WITH_CLAY_ENGINE)
add_definitions(-DWITH_CLAY_ENGINE)
endif()
data_to_c_simple(engines/clay/shaders/clay_frag.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_fxaa.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_copy.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_prepass_frag.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_vert.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_particle_vert.glsl SRC)
data_to_c_simple(engines/clay/shaders/clay_particle_strand_frag.glsl SRC)
data_to_c_simple(engines/clay/shaders/ssao_alchemy.glsl SRC)
data_to_c_simple(engines/clay/shaders/ssao_groundtruth.glsl SRC)
data_to_c_simple(engines/eevee/shaders/ambient_occlusion_lib.glsl SRC)
data_to_c_simple(engines/eevee/shaders/default_frag.glsl SRC)
data_to_c_simple(engines/eevee/shaders/default_world_frag.glsl SRC)

View File

@ -1,985 +0,0 @@
/*
* Copyright 2016, Blender Foundation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Institute
*
*/
#include "BLI_utildefines.h"
#include "BLI_string_utils.h"
#include "BLI_rand.h"
#include "DNA_particle_types.h"
#include "DNA_view3d_types.h"
#include "BKE_icons.h"
#include "BKE_idprop.h"
#include "BKE_main.h"
#include "BKE_particle.h"
#include "GPU_shader.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "UI_resources.h"
#include "UI_interface_icons.h"
#include "DRW_render.h"
#include "DEG_depsgraph_query.h"
#include "clay_engine.h"
#ifdef WITH_CLAY_ENGINE
#include "../eevee/eevee_lut.h" /* TODO find somewhere to share blue noise Table */
/* Shaders */
#define CLAY_ENGINE "BLENDER_CLAY"
#define MAX_CLAY_MAT 512 /* 512 = 9 bit material id */
#define SHADER_DEFINES_NO_AO \
"#define MAX_MATERIAL " STRINGIFY(MAX_CLAY_MAT) "\n" \
"#define USE_ROTATION\n" \
"#define USE_HSV\n"
#define SHADER_DEFINES \
SHADER_DEFINES_NO_AO \
"#define USE_AO\n"
extern char datatoc_clay_frag_glsl[];
extern char datatoc_clay_prepass_frag_glsl[];
extern char datatoc_clay_copy_glsl[];
extern char datatoc_clay_vert_glsl[];
extern char datatoc_clay_fxaa_glsl[];
extern char datatoc_clay_particle_vert_glsl[];
extern char datatoc_clay_particle_strand_frag_glsl[];
extern char datatoc_ssao_alchemy_glsl[];
extern char datatoc_common_fxaa_lib_glsl[];
/* *********** LISTS *********** */
/**
* UBOs data needs to be 16 byte aligned (size of vec4)
*
* Reminder: float, int, bool are 4 bytes
*
* \note struct is expected to be initialized with all pad-bits zero'd
* so we can use 'memcmp' to check for duplicates. Possibly hash data later.
*/
typedef struct CLAY_UBO_Material {
float ssao_params_var[4];
/* - 16 -*/
float matcap_hsv[3];
float matcap_id; /* even float encoding have enough precision */
/* - 16 -*/
float matcap_rot[2];
float pad[2]; /* ensure 16 bytes alignement */
} CLAY_UBO_Material; /* 48 bytes */
BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16)
typedef struct CLAY_HAIR_UBO_Material {
float hair_randomness;
float matcap_id;
float matcap_rot[2];
float matcap_hsv[3];
float pad;
} CLAY_HAIR_UBO_Material; /* 32 bytes */
BLI_STATIC_ASSERT_ALIGN(CLAY_HAIR_UBO_Material, 16)
typedef struct CLAY_UBO_Storage {
CLAY_UBO_Material materials[MAX_CLAY_MAT];
} CLAY_UBO_Storage;
typedef struct CLAY_HAIR_UBO_Storage {
CLAY_HAIR_UBO_Material materials[MAX_CLAY_MAT];
} CLAY_HAIR_UBO_Storage;
/* GPUViewport.storage
* Is freed everytime the viewport engine changes */
typedef struct CLAY_Storage {
/* Materials Parameter UBO */
CLAY_UBO_Storage mat_storage;
CLAY_HAIR_UBO_Storage hair_mat_storage;
int ubo_current_id;
int hair_ubo_current_id;
DRWShadingGroup *shgrps[MAX_CLAY_MAT];
DRWShadingGroup *shgrps_flat[MAX_CLAY_MAT];
DRWShadingGroup *shgrps_pre[MAX_CLAY_MAT];
DRWShadingGroup *shgrps_pre_flat[MAX_CLAY_MAT];
DRWShadingGroup *hair_shgrps[MAX_CLAY_MAT];
} CLAY_Storage;
typedef struct CLAY_StorageList {
struct CLAY_Storage *storage;
struct CLAY_PrivateData *g_data;
} CLAY_StorageList;
typedef struct CLAY_FramebufferList {
struct GPUFrameBuffer *antialias_fb;
struct GPUFrameBuffer *prepass_fb;
} CLAY_FramebufferList;
typedef struct CLAY_PassList {
struct DRWPass *clay_ps;
struct DRWPass *clay_cull_ps;
struct DRWPass *clay_flat_ps;
struct DRWPass *clay_flat_cull_ps;
struct DRWPass *clay_pre_ps;
struct DRWPass *clay_pre_cull_ps;
struct DRWPass *clay_flat_pre_ps;
struct DRWPass *clay_flat_pre_cull_ps;
struct DRWPass *clay_deferred_ps;
struct DRWPass *fxaa_ps;
struct DRWPass *copy_ps;
struct DRWPass *hair_pass;
} CLAY_PassList;
typedef struct CLAY_Data {
void *engine_type;
CLAY_FramebufferList *fbl;
DRWViewportEmptyList *txl;
CLAY_PassList *psl;
CLAY_StorageList *stl;
} CLAY_Data;
typedef struct CLAY_ViewLayerData {
struct GPUTexture *jitter_tx;
struct GPUUniformBuffer *mat_ubo;
struct GPUUniformBuffer *matcaps_ubo;
struct GPUUniformBuffer *hair_mat_ubo;
struct GPUUniformBuffer *sampling_ubo;
int cached_sample_num;
} CLAY_ViewLayerData;
/* *********** STATIC *********** */
static struct {
/* Shading Pass */
struct GPUShader *clay_sh;
struct GPUShader *clay_flat_sh;
struct GPUShader *clay_prepass_flat_sh;
struct GPUShader *clay_prepass_sh;
struct GPUShader *clay_deferred_shading_sh;
struct GPUShader *fxaa_sh;
struct GPUShader *copy_sh;
struct GPUShader *hair_sh;
/* Matcap textures */
struct GPUTexture *matcap_array;
float matcap_colors[24][4];
/* Just a serie of int from 0 to MAX_CLAY_MAT-1 */
int ubo_mat_idxs[MAX_CLAY_MAT];
/* To avoid useless texture and ubo binds. */
bool first_shgrp;
} e_data = {NULL}; /* Engine data */
typedef struct CLAY_PrivateData {
DRWShadingGroup *depth_shgrp;
DRWShadingGroup *depth_shgrp_select;
DRWShadingGroup *depth_shgrp_active;
DRWShadingGroup *depth_shgrp_cull;
DRWShadingGroup *depth_shgrp_cull_select;
DRWShadingGroup *depth_shgrp_cull_active;
/* Deferred shading */
struct GPUTexture *depth_tx; /* ref only, not alloced */
struct GPUTexture *normal_tx; /* ref only, not alloced */
struct GPUTexture *id_tx; /* ref only, not alloced */
struct GPUTexture *color_copy; /* ref only, not alloced */
bool enable_deferred_path;
/* Ssao */
float winmat[4][4];
float viewvecs[3][4];
float ssao_params[4];
} CLAY_PrivateData; /* Transient data */
/* Functions */
static void clay_view_layer_data_free(void *storage)
{
CLAY_ViewLayerData *sldata = (CLAY_ViewLayerData *)storage;
DRW_UBO_FREE_SAFE(sldata->mat_ubo);
DRW_UBO_FREE_SAFE(sldata->matcaps_ubo);
DRW_UBO_FREE_SAFE(sldata->hair_mat_ubo);
DRW_UBO_FREE_SAFE(sldata->sampling_ubo);
DRW_TEXTURE_FREE_SAFE(sldata->jitter_tx);
}
static CLAY_ViewLayerData *CLAY_view_layer_data_get(void)
{
CLAY_ViewLayerData **sldata = (CLAY_ViewLayerData **)DRW_view_layer_engine_data_ensure(
&draw_engine_clay_type, &clay_view_layer_data_free);
if (*sldata == NULL) {
*sldata = MEM_callocN(sizeof(**sldata), "CLAY_ViewLayerData");
}
return *sldata;
}
static void add_icon_to_rect(PreviewImage *prv, float *final_rect, int layer)
{
int image_size = prv->w[0] * prv->h[0];
float *new_rect = &final_rect[image_size * 4 * layer];
IMB_buffer_float_from_byte(new_rect, (unsigned char *)prv->rect[0], IB_PROFILE_SRGB, IB_PROFILE_SRGB,
false, prv->w[0], prv->h[0], prv->w[0], prv->w[0]);
/* Find overall color */
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
e_data.matcap_colors[layer][0] += new_rect[y * 512 * 128 * 4 + x * 128 * 4 + 0];
e_data.matcap_colors[layer][1] += new_rect[y * 512 * 128 * 4 + x * 128 * 4 + 1];
e_data.matcap_colors[layer][2] += new_rect[y * 512 * 128 * 4 + x * 128 * 4 + 2];
}
}
e_data.matcap_colors[layer][0] /= 16.0f * 2.0f; /* the * 2 is to darken for shadows */
e_data.matcap_colors[layer][1] /= 16.0f * 2.0f;
e_data.matcap_colors[layer][2] /= 16.0f * 2.0f;
}
static struct GPUTexture *load_matcaps(PreviewImage *prv[24], int nbr)
{
struct GPUTexture *tex;
int w = prv[0]->w[0];
int h = prv[0]->h[0];
float *final_rect = MEM_callocN(sizeof(float) * 4 * w * h * nbr, "Clay Matcap array rect");
for (int i = 0; i < nbr; ++i) {
add_icon_to_rect(prv[i], final_rect, i);
BKE_previewimg_free(&prv[i]);
}
tex = DRW_texture_create_2D_array(w, h, nbr, GPU_RGBA8, DRW_TEX_FILTER, final_rect);
MEM_freeN(final_rect);
return tex;
}
static int matcap_to_index(int matcap)
{
return matcap - 1;
}
/* Using Hammersley distribution */
static float *create_disk_samples(int num_samples)
{
/* vec4 to ensure memory alignment. */
float (*texels)[4] = MEM_mallocN(sizeof(float[4]) * num_samples, "concentric_tex");
const float num_samples_inv = 1.0f / num_samples;
for (int i = 0; i < num_samples; i++) {
float r = (i + 0.5f) * num_samples_inv;
double dphi;
BLI_hammersley_1D(i, &dphi);
float phi = (float)dphi * 2.0f * M_PI;
texels[i][0] = cosf(phi);
texels[i][1] = sinf(phi);
/* This deliberatly distribute more samples
* at the center of the disk (and thus the shadow). */
texels[i][2] = r;
}
return (float *)texels;
}
static struct GPUTexture *create_jitter_texture(int num_samples)
{
float jitter[64 * 64][3];
const float num_samples_inv = 1.0f / num_samples;
for (int i = 0; i < 64 * 64; i++) {
float phi = blue_noise[i][0] * 2.0f * M_PI;
/* This rotate the sample per pixels */
jitter[i][0] = cosf(phi);
jitter[i][1] = sinf(phi);
/* This offset the sample along it's direction axis (reduce banding) */
float bn = blue_noise[i][1] - 0.5f;
CLAMP(bn, -0.499f, 0.499f); /* fix fireflies */
jitter[i][2] = bn * num_samples_inv;
}
UNUSED_VARS(bsdf_split_sum_ggx, btdf_split_sum_ggx, ltc_mag_ggx, ltc_mat_ggx, ltc_disk_integral);
return DRW_texture_create_2D(64, 64, GPU_RGB16F, DRW_TEX_FILTER | DRW_TEX_WRAP, &jitter[0][0]);
}
static void clay_engine_init(void *vedata)
{
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
CLAY_FramebufferList *fbl = ((CLAY_Data *)vedata)->fbl;
CLAY_ViewLayerData *sldata = CLAY_view_layer_data_get();
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
/* Create Texture Array */
if (!e_data.matcap_array) {
PreviewImage *prv[24]; /* For now use all of the 24 internal matcaps */
const int num_matcap = ARRAY_SIZE(prv);
/* TODO only load used matcaps */
for (int i = 0; i < num_matcap; ++i) {
prv[i] = UI_icon_to_preview((int)ICON_MATCAP_01 + i);
}
e_data.matcap_array = load_matcaps(prv, num_matcap);
}
/* Shading pass */
if (!e_data.clay_sh) {
char *matcap_with_ao = BLI_string_joinN(
datatoc_clay_frag_glsl,
datatoc_ssao_alchemy_glsl);
e_data.clay_sh = DRW_shader_create(
datatoc_clay_vert_glsl, NULL, datatoc_clay_frag_glsl,
SHADER_DEFINES_NO_AO);
e_data.clay_flat_sh = DRW_shader_create(
datatoc_clay_vert_glsl, NULL, datatoc_clay_frag_glsl,
SHADER_DEFINES_NO_AO
"#define USE_FLAT_NORMAL\n");
e_data.clay_prepass_sh = DRW_shader_create(
datatoc_clay_vert_glsl, NULL, datatoc_clay_prepass_frag_glsl,
SHADER_DEFINES);
e_data.clay_prepass_flat_sh = DRW_shader_create(
datatoc_clay_vert_glsl, NULL, datatoc_clay_prepass_frag_glsl,
SHADER_DEFINES
"#define USE_FLAT_NORMAL\n");
e_data.clay_deferred_shading_sh = DRW_shader_create_fullscreen(
matcap_with_ao,
SHADER_DEFINES
"#define DEFERRED_SHADING\n");
MEM_freeN(matcap_with_ao);
char *fxaa_str = BLI_string_joinN(
datatoc_common_fxaa_lib_glsl,
datatoc_clay_fxaa_glsl);
e_data.fxaa_sh = DRW_shader_create_fullscreen(fxaa_str, NULL);
MEM_freeN(fxaa_str);
e_data.copy_sh = DRW_shader_create_fullscreen(datatoc_clay_copy_glsl, NULL);
}
if (!stl->storage) {
stl->storage = MEM_callocN(sizeof(CLAY_Storage), "CLAY_Storage");
}
if (!stl->g_data) {
stl->g_data = MEM_mallocN(sizeof(*stl->g_data), "CLAY_PrivateStorage");
}
CLAY_PrivateData *g_data = stl->g_data;
if (!sldata->mat_ubo) {
sldata->mat_ubo = DRW_uniformbuffer_create(sizeof(CLAY_UBO_Storage), NULL);
}
if (!sldata->hair_mat_ubo) {
sldata->hair_mat_ubo = DRW_uniformbuffer_create(sizeof(CLAY_HAIR_UBO_Storage), NULL);
}
if (!sldata->matcaps_ubo) {
sldata->matcaps_ubo = DRW_uniformbuffer_create(sizeof(e_data.matcap_colors), e_data.matcap_colors);
}
if (e_data.ubo_mat_idxs[1] == 0) {
/* Just int to have pointers to them */
for (int i = 0; i < MAX_CLAY_MAT; ++i) {
e_data.ubo_mat_idxs[i] = i;
}
}
/* FBO setup */
{
const float *viewport_size = DRW_viewport_size_get();
const int size[2] = {(int)viewport_size[0], (int)viewport_size[1]};
g_data->normal_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_RG8, &draw_engine_clay_type);
g_data->id_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_R16UI, &draw_engine_clay_type);
GPU_framebuffer_ensure_config(&fbl->prepass_fb, {
GPU_ATTACHMENT_TEXTURE(dtxl->depth),
GPU_ATTACHMENT_TEXTURE(g_data->normal_tx),
GPU_ATTACHMENT_TEXTURE(g_data->id_tx)
});
/* For FXAA */
/* TODO(fclem): OPTI: we could merge normal_tx and id_tx into a GPU_RGBA8
* and reuse it for the fxaa target. */
g_data->color_copy = DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA8, &draw_engine_clay_type);
GPU_framebuffer_ensure_config(&fbl->antialias_fb, {
GPU_ATTACHMENT_NONE,
GPU_ATTACHMENT_TEXTURE(g_data->color_copy)
});
}
/* SSAO setup */
{
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
const int ssao_samples = scene_eval->display.matcap_ssao_samples;
float invproj[4][4];
float dfdyfacs[2];
const bool is_persp = DRW_viewport_is_persp_get();
/* view vectors for the corners of the view frustum.
* Can be used to recreate the world space position easily */
float viewvecs[3][4] = {
{-1.0f, -1.0f, -1.0f, 1.0f},
{1.0f, -1.0f, -1.0f, 1.0f},
{-1.0f, 1.0f, -1.0f, 1.0f}
};
int i;
const float *size = DRW_viewport_size_get();
DRW_state_dfdy_factors_get(dfdyfacs);
g_data->ssao_params[0] = ssao_samples;
g_data->ssao_params[1] = size[0] / 64.0;
g_data->ssao_params[2] = size[1] / 64.0;
g_data->ssao_params[3] = dfdyfacs[1]; /* dfdy sign for offscreen */
/* invert the view matrix */
DRW_viewport_matrix_get(g_data->winmat, DRW_MAT_WIN);
invert_m4_m4(invproj, g_data->winmat);
/* convert the view vectors to view space */
for (i = 0; i < 3; i++) {
mul_m4_v4(invproj, viewvecs[i]);
/* normalized trick see:
* http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer */
mul_v3_fl(viewvecs[i], 1.0f / viewvecs[i][3]);
if (is_persp)
mul_v3_fl(viewvecs[i], 1.0f / viewvecs[i][2]);
viewvecs[i][3] = 1.0;
copy_v4_v4(g_data->viewvecs[i], viewvecs[i]);
}
/* we need to store the differences */
g_data->viewvecs[1][0] -= g_data->viewvecs[0][0];
g_data->viewvecs[1][1] = g_data->viewvecs[2][1] - g_data->viewvecs[0][1];
/* calculate a depth offset as well */
if (!is_persp) {
float vec_far[] = {-1.0f, -1.0f, 1.0f, 1.0f};
mul_m4_v4(invproj, vec_far);
mul_v3_fl(vec_far, 1.0f / vec_far[3]);
g_data->viewvecs[1][2] = vec_far[2] - g_data->viewvecs[0][2];
}
/* AO Samples Tex */
if (sldata->sampling_ubo && (sldata->cached_sample_num != ssao_samples)) {
DRW_UBO_FREE_SAFE(sldata->sampling_ubo);
DRW_TEXTURE_FREE_SAFE(sldata->jitter_tx);
}
if (sldata->sampling_ubo == NULL) {
float *samples = create_disk_samples(ssao_samples);
sldata->jitter_tx = create_jitter_texture(ssao_samples);
sldata->sampling_ubo = DRW_uniformbuffer_create(sizeof(float[4]) * ssao_samples, samples);
sldata->cached_sample_num = ssao_samples;
MEM_freeN(samples);
}
}
}
static DRWShadingGroup *CLAY_shgroup_create(DRWPass *pass, GPUShader *sh, int id)
{
CLAY_ViewLayerData *sldata = CLAY_view_layer_data_get();
DRWShadingGroup *grp = DRW_shgroup_create(sh, pass);
DRW_shgroup_uniform_int(grp, "mat_id", &e_data.ubo_mat_idxs[id], 1);
if (e_data.first_shgrp) {
DRW_shgroup_uniform_texture_persistent(grp, "matcaps", e_data.matcap_array);
DRW_shgroup_uniform_block_persistent(grp, "material_block", sldata->mat_ubo);
DRW_shgroup_uniform_block_persistent(grp, "matcaps_block", sldata->matcaps_ubo);
}
return grp;
}
static DRWShadingGroup *CLAY_shgroup_deferred_prepass_create(DRWPass *pass, GPUShader *sh, int id)
{
DRWShadingGroup *grp = DRW_shgroup_create(sh, pass);
DRW_shgroup_uniform_int(grp, "mat_id", &e_data.ubo_mat_idxs[id], 1);
return grp;
}
static DRWShadingGroup *CLAY_shgroup_deferred_shading_create(DRWPass *pass, CLAY_PrivateData *g_data)
{
CLAY_ViewLayerData *sldata = CLAY_view_layer_data_get();
DRWShadingGroup *grp = DRW_shgroup_create(e_data.clay_deferred_shading_sh, pass);
DRW_shgroup_uniform_texture_ref(grp, "depthtex", &g_data->depth_tx);
DRW_shgroup_uniform_texture_ref(grp, "normaltex", &g_data->normal_tx);
DRW_shgroup_uniform_texture_ref(grp, "idtex", &g_data->id_tx);
DRW_shgroup_uniform_texture(grp, "matcaps", e_data.matcap_array);
DRW_shgroup_uniform_texture(grp, "ssao_jitter", sldata->jitter_tx);
DRW_shgroup_uniform_block(grp, "samples_block", sldata->sampling_ubo);
DRW_shgroup_uniform_block(grp, "material_block", sldata->mat_ubo);
DRW_shgroup_uniform_block(grp, "matcaps_block", sldata->matcaps_ubo);
/* TODO put in ubo */
DRW_shgroup_uniform_mat4(grp, "WinMatrix", g_data->winmat);
DRW_shgroup_uniform_vec2(grp, "invscreenres", DRW_viewport_invert_size_get(), 1);
DRW_shgroup_uniform_vec4(grp, "viewvecs[0]", (float *)g_data->viewvecs, 3);
DRW_shgroup_uniform_vec4(grp, "ssao_params", g_data->ssao_params, 1);
return grp;
}
static DRWShadingGroup *CLAY_hair_shgroup_create(DRWPass *pass, int id)
{
CLAY_ViewLayerData *sldata = CLAY_view_layer_data_get();
if (!e_data.hair_sh) {
e_data.hair_sh = DRW_shader_create(
datatoc_clay_particle_vert_glsl, NULL, datatoc_clay_particle_strand_frag_glsl,
"#define MAX_MATERIAL " STRINGIFY(MAX_CLAY_MAT) "\n" );
}
DRWShadingGroup *grp = DRW_shgroup_create(e_data.hair_sh, pass);
DRW_shgroup_uniform_texture(grp, "matcaps", e_data.matcap_array);
DRW_shgroup_uniform_block(grp, "material_block", sldata->mat_ubo);
DRW_shgroup_uniform_int(grp, "mat_id", &e_data.ubo_mat_idxs[id], 1);
return grp;
}
static int search_mat_to_ubo(CLAY_Storage *storage, const CLAY_UBO_Material *mat_ubo_test)
{
/* For now just use a linear search and test all parameters */
/* TODO make a hash table */
for (int i = 0; i < storage->ubo_current_id; ++i) {
CLAY_UBO_Material *ubo = &storage->mat_storage.materials[i];
if (memcmp(ubo, mat_ubo_test, sizeof(*mat_ubo_test)) == 0) {
return i;
}
}
return -1;
}
static int search_hair_mat_to_ubo(CLAY_Storage *storage, const CLAY_HAIR_UBO_Material *hair_mat_ubo_test)
{
/* For now just use a linear search and test all parameters */
/* TODO make a hash table */
for (int i = 0; i < storage->hair_ubo_current_id; ++i) {
CLAY_HAIR_UBO_Material *ubo = &storage->hair_mat_storage.materials[i];
if (memcmp(ubo, hair_mat_ubo_test, sizeof(*hair_mat_ubo_test)) == 0) {
return i;
}
}
return -1;
}
static int push_mat_to_ubo(CLAY_Storage *storage, const CLAY_UBO_Material *mat_ubo_test)
{
int id = storage->ubo_current_id++;
id = min_ii(MAX_CLAY_MAT, id);
storage->mat_storage.materials[id] = *mat_ubo_test;
return id;
}
static int push_hair_mat_to_ubo(CLAY_Storage *storage, const CLAY_HAIR_UBO_Material *hair_mat_ubo_test)
{
int id = storage->hair_ubo_current_id++;
id = min_ii(MAX_CLAY_MAT, id);
storage->hair_mat_storage.materials[id] = *hair_mat_ubo_test;
return id;
}
static int mat_in_ubo(CLAY_Storage *storage, const CLAY_UBO_Material *mat_ubo_test)
{
/* Search material in UBO */
int id = search_mat_to_ubo(storage, mat_ubo_test);
/* if not found create it */
if (id == -1) {
id = push_mat_to_ubo(storage, mat_ubo_test);
}
return id;
}
static int hair_mat_in_ubo(CLAY_Storage *storage, const CLAY_HAIR_UBO_Material *hair_mat_ubo_test)
{
/* Search material in UBO */
int id = search_hair_mat_to_ubo(storage, hair_mat_ubo_test);
/* if not found create it */
if (id == -1) {
id = push_hair_mat_to_ubo(storage, hair_mat_ubo_test);
}
return id;
}
static void ubo_mat_from_object(CLAY_Storage *storage, Object *UNUSED(ob), bool *r_needs_ao, int *r_id)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
const int matcap_icon = scene_eval->display.matcap_icon;
const float matcap_rot = scene_eval->display.matcap_rotation;
const float matcap_hue = scene_eval->display.matcap_hue;
const float matcap_sat = scene_eval->display.matcap_saturation;
const float matcap_val = scene_eval->display.matcap_value;
const float ssao_distance = scene_eval->display.matcap_ssao_distance;
const float ssao_factor_cavity = scene_eval->display.matcap_ssao_factor_cavity;
const float ssao_factor_edge = scene_eval->display.matcap_ssao_factor_edge;
const float ssao_attenuation = scene_eval->display.matcap_ssao_attenuation;
CLAY_UBO_Material r_ubo = {{0.0f}};
if (((ssao_factor_cavity > 0.0) || (ssao_factor_edge > 0.0)) &&
(ssao_distance > 0.0))
{
*r_needs_ao = true;
r_ubo.ssao_params_var[0] = ssao_distance;
r_ubo.ssao_params_var[1] = ssao_factor_cavity;
r_ubo.ssao_params_var[2] = ssao_factor_edge;
r_ubo.ssao_params_var[3] = ssao_attenuation;
}
else {
*r_needs_ao = false;
}
r_ubo.matcap_rot[0] = cosf(matcap_rot * 3.14159f * 2.0f);
r_ubo.matcap_rot[1] = sinf(matcap_rot * 3.14159f * 2.0f);
r_ubo.matcap_hsv[0] = matcap_hue + 0.5f;
r_ubo.matcap_hsv[1] = matcap_sat * 2.0f;
r_ubo.matcap_hsv[2] = matcap_val * 2.0f;
r_ubo.matcap_id = matcap_to_index(matcap_icon);
*r_id = mat_in_ubo(storage, &r_ubo);
}
static void hair_ubo_mat_from_object(Object *UNUSED(ob), CLAY_HAIR_UBO_Material *r_ubo)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
const int matcap_icon = scene_eval->display.matcap_icon;
const float matcap_rot = scene_eval->display.matcap_rotation;
const float matcap_hue = scene_eval->display.matcap_hue;
const float matcap_sat = scene_eval->display.matcap_saturation;
const float matcap_val = scene_eval->display.matcap_value;
const float hair_randomness = scene_eval->display.matcap_hair_brightness_randomness;
memset(r_ubo, 0x0, sizeof(*r_ubo));
r_ubo->matcap_rot[0] = cosf(matcap_rot * 3.14159f * 2.0f);
r_ubo->matcap_rot[1] = sinf(matcap_rot * 3.14159f * 2.0f);
r_ubo->matcap_hsv[0] = matcap_hue + 0.5f;
r_ubo->matcap_hsv[1] = matcap_sat * 2.0f;
r_ubo->matcap_hsv[2] = matcap_val * 2.0f;
r_ubo->hair_randomness = hair_randomness;
r_ubo->matcap_id = matcap_to_index(matcap_icon);
}
static DRWShadingGroup *CLAY_object_shgrp_get(CLAY_Data *vedata, Object *ob, bool use_flat, bool cull)
{
bool prepass; int id;
CLAY_PassList *psl = vedata->psl;
CLAY_Storage *storage = vedata->stl->storage;
DRWShadingGroup **shgrps;
DRWPass *pass; GPUShader *sh;
ubo_mat_from_object(storage, ob, &prepass, &id);
if (prepass) {
if (use_flat) {
shgrps = storage->shgrps_pre_flat;
pass = (cull) ? psl->clay_flat_pre_cull_ps : psl->clay_flat_pre_ps;
sh = e_data.clay_prepass_flat_sh;
}
else {
shgrps = storage->shgrps_pre;
pass = (cull) ? psl->clay_pre_cull_ps : psl->clay_pre_ps;
sh = e_data.clay_prepass_sh;
}
if (shgrps[id] == NULL) {
shgrps[id] = CLAY_shgroup_deferred_prepass_create(pass, sh, id);
}
vedata->stl->g_data->enable_deferred_path = true;
}
else {
if (use_flat) {
shgrps = storage->shgrps_flat;
pass = (cull) ? psl->clay_flat_cull_ps : psl->clay_flat_ps;
sh = e_data.clay_flat_sh;
}
else {
shgrps = storage->shgrps;
pass = (cull) ? psl->clay_cull_ps : psl->clay_ps;
sh = e_data.clay_sh;
}
if (shgrps[id] == NULL) {
shgrps[id] = CLAY_shgroup_create(pass, sh, id);
e_data.first_shgrp = false;
}
}
return shgrps[id];
}
static DRWShadingGroup *CLAY_hair_shgrp_get(
CLAY_Data *UNUSED(vedata), Object *ob, CLAY_StorageList *stl, CLAY_PassList *psl)
{
DRWShadingGroup **hair_shgrps = stl->storage->hair_shgrps;
CLAY_HAIR_UBO_Material hair_mat_ubo_test;
hair_ubo_mat_from_object(ob, &hair_mat_ubo_test);
int hair_id = hair_mat_in_ubo(stl->storage, &hair_mat_ubo_test);
if (hair_shgrps[hair_id] == NULL) {
hair_shgrps[hair_id] = CLAY_hair_shgroup_create(psl->hair_pass, hair_id);
}
return hair_shgrps[hair_id];
}
static void clay_cache_init(void *vedata)
{
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl;
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
/* Disable AO unless a material needs it. */
stl->g_data->enable_deferred_path = false;
/* Reset UBO datas, shgrp pointers and material id counters. */
memset(stl->storage, 0, sizeof(*stl->storage));
e_data.first_shgrp = true;
/* Solid Passes */
{
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
psl->clay_ps = DRW_pass_create("Clay", state);
psl->clay_cull_ps = DRW_pass_create("Clay Culled", state | DRW_STATE_CULL_BACK);
psl->clay_flat_ps = DRW_pass_create("Clay Flat", state);
psl->clay_flat_cull_ps = DRW_pass_create("Clay Flat Culled", state | DRW_STATE_CULL_BACK);
DRWState prepass_state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
DRWState prepass_cull_state = prepass_state | DRW_STATE_CULL_BACK;
psl->clay_pre_ps = DRW_pass_create("Clay Deferred Pre", prepass_state);
psl->clay_pre_cull_ps = DRW_pass_create("Clay Deferred Pre Culled", prepass_cull_state);
psl->clay_flat_pre_ps = DRW_pass_create("Clay Deferred Flat Pre", prepass_state);
psl->clay_flat_pre_cull_ps = DRW_pass_create("Clay Deferred Flat Pre Culled", prepass_cull_state);
psl->clay_deferred_ps = DRW_pass_create("Clay Deferred Shading", DRW_STATE_WRITE_COLOR);
DRWShadingGroup *grp = CLAY_shgroup_deferred_shading_create(psl->clay_deferred_ps, stl->g_data);
DRW_shgroup_call_add(grp, DRW_cache_fullscreen_quad_get(), NULL);
}
/* Hair Pass */
{
psl->hair_pass = DRW_pass_create(
"Hair Pass",
DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE);
}
{
psl->fxaa_ps = DRW_pass_create("Fxaa", DRW_STATE_WRITE_COLOR);
DRWShadingGroup *grp = DRW_shgroup_create(e_data.fxaa_sh, psl->fxaa_ps);
DRW_shgroup_uniform_texture_ref(grp, "colortex", &dtxl->color);
DRW_shgroup_uniform_vec2(grp, "invscreenres", DRW_viewport_invert_size_get(), 1);
DRW_shgroup_call_add(grp, DRW_cache_fullscreen_quad_get(), NULL);
psl->copy_ps = DRW_pass_create("Copy", DRW_STATE_WRITE_COLOR);
grp = DRW_shgroup_create(e_data.copy_sh, psl->copy_ps);
DRW_shgroup_uniform_texture_ref(grp, "colortex", &stl->g_data->color_copy);
DRW_shgroup_call_add(grp, DRW_cache_fullscreen_quad_get(), NULL);
}
}
static void clay_cache_populate_particles(void *vedata, Object *ob)
{
CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl;
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
if (ob == draw_ctx->object_edit) {
return;
}
for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) {
if (!psys_check_enabled(ob, psys, false)) {
continue;
}
if (!DRW_check_psys_visible_within_active_context(ob, psys)) {
continue;
}
ParticleSettings *part = psys->part;
const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(ob, psys, NULL);
DRWShadingGroup *hair_shgrp = CLAY_hair_shgrp_get(vedata, ob, stl, psl);
DRW_shgroup_call_add(hair_shgrp, geom, NULL);
}
}
}
static void clay_cache_populate(void *vedata, Object *ob)
{
DRWShadingGroup *clay_shgrp;
if (!DRW_object_is_renderable(ob))
return;
const DRWContextState *draw_ctx = DRW_context_state_get();
const bool is_active = (ob == draw_ctx->obact);
if (is_active) {
if (DRW_object_is_mode_shade(ob) == true) {
return;
}
}
/* Handle particles first in case the emitter itself shouldn't be rendered. */
if (ob->type == OB_MESH) {
clay_cache_populate_particles(vedata, ob);
}
if (DRW_check_object_visible_within_active_context(ob) == false) {
return;
}
struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob);
if (geom) {
const bool do_cull = (draw_ctx->v3d && (draw_ctx->v3d->flag2 & V3D_BACKFACE_CULLING));
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool use_flat = is_sculpt_mode && DRW_object_is_flat_normal(ob);
clay_shgrp = CLAY_object_shgrp_get(vedata, ob, use_flat, do_cull);
if (is_sculpt_mode) {
DRW_shgroup_call_sculpt_add(clay_shgrp, ob, ob->obmat);
}
else {
DRW_shgroup_call_object_add(clay_shgrp, geom, ob);
}
}
}
static void clay_cache_finish(void *vedata)
{
CLAY_ViewLayerData *sldata = CLAY_view_layer_data_get();
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
DRW_uniformbuffer_update(sldata->mat_ubo, &stl->storage->mat_storage);
DRW_uniformbuffer_update(sldata->hair_mat_ubo, &stl->storage->hair_mat_storage);
}
static void clay_draw_scene(void *vedata)
{
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl;
CLAY_FramebufferList *fbl = ((CLAY_Data *)vedata)->fbl;
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
stl->g_data->depth_tx = dtxl->depth;
/* Passes are ordered to have less _potential_ overdraw */
DRW_draw_pass(psl->clay_cull_ps);
DRW_draw_pass(psl->clay_flat_cull_ps);
DRW_draw_pass(psl->clay_ps);
DRW_draw_pass(psl->clay_flat_ps);
DRW_draw_pass(psl->hair_pass);
if (stl->g_data->enable_deferred_path) {
GPU_framebuffer_bind(fbl->prepass_fb);
/* We need to clear the id texture unfortunately. */
const float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
GPU_framebuffer_clear_color(fbl->prepass_fb, clear_col);
DRW_draw_pass(psl->clay_pre_cull_ps);
DRW_draw_pass(psl->clay_flat_pre_cull_ps);
DRW_draw_pass(psl->clay_pre_ps);
DRW_draw_pass(psl->clay_flat_pre_ps);
GPU_framebuffer_bind(dfbl->color_only_fb);
DRW_draw_pass(psl->clay_deferred_ps);
}
if (true) { /* Always on for now. We might want a parameter for this. */
GPU_framebuffer_bind(fbl->antialias_fb);
DRW_draw_pass(psl->fxaa_ps);
GPU_framebuffer_bind(dfbl->color_only_fb);
DRW_draw_pass(psl->copy_ps);
}
}
static void clay_engine_free(void)
{
DRW_SHADER_FREE_SAFE(e_data.clay_sh);
DRW_SHADER_FREE_SAFE(e_data.clay_flat_sh);
DRW_SHADER_FREE_SAFE(e_data.clay_prepass_flat_sh);
DRW_SHADER_FREE_SAFE(e_data.clay_prepass_sh);
DRW_SHADER_FREE_SAFE(e_data.clay_deferred_shading_sh);
DRW_SHADER_FREE_SAFE(e_data.fxaa_sh);
DRW_SHADER_FREE_SAFE(e_data.copy_sh);
DRW_SHADER_FREE_SAFE(e_data.hair_sh);
DRW_TEXTURE_FREE_SAFE(e_data.matcap_array);
}
static const DrawEngineDataSize clay_data_size = DRW_VIEWPORT_DATA_SIZE(CLAY_Data);
DrawEngineType draw_engine_clay_type = {
NULL, NULL,
N_("Clay"),
&clay_data_size,
&clay_engine_init,
&clay_engine_free,
&clay_cache_init,
&clay_cache_populate,
&clay_cache_finish,
NULL,
&clay_draw_scene,
NULL,
NULL,
NULL,
};
RenderEngineType DRW_engine_viewport_clay_type = {
NULL, NULL,
CLAY_ENGINE, N_("Clay"), RE_INTERNAL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
&draw_engine_clay_type,
{NULL, NULL, NULL}
};
#undef CLAY_ENGINE
#endif /* WITH_CLAY_ENGINE */

View File

@ -1,36 +0,0 @@
/*
* Copyright 2016, Blender Foundation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Institute
*
*/
/** \file clay_engine.h
* \ingroup draw_engine
*/
#ifndef __CLAY_ENGINE_H__
#define __CLAY_ENGINE_H__
extern DrawEngineType draw_engine_clay_type;
extern RenderEngineType DRW_engine_viewport_clay_type;
struct IDProperty;
struct IDProperty *CLAY_render_settings_create(void);
#endif /* __CLAY_ENGINE_H__ */

View File

@ -1,10 +0,0 @@
in vec4 uvcoordsvar;
out vec4 fragColor;
uniform sampler2D colortex;
void main()
{
fragColor = texture(colortex, uvcoordsvar.st);
}

View File

@ -1,252 +0,0 @@
uniform vec2 invscreenres;
uniform mat4 WinMatrix;
/* Matcap */
uniform sampler2DArray matcaps;
/* Screen Space Occlusion */
/* store the view space vectors for the corners of the view frustum here.
* It helps to quickly reconstruct view space vectors by using uv coordinates,
* see http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer */
uniform vec4 viewvecs[3];
uniform vec4 ssao_params;
uniform sampler2D ssao_jitter;
/* Material Parameters packed in an UBO */
struct Material {
vec4 ssao_params_var;
vec4 matcap_hsv_id;
vec4 matcap_rot; /* vec4 to ensure 16 bytes alignement (don't trust compiler) */
};
layout(std140) uniform samples_block {
vec4 ssao_samples[500];
};
layout(std140) uniform matcaps_block {
vec4 matcaps_color[24];
};
layout(std140) uniform material_block {
Material matcaps_param[MAX_MATERIAL];
};
#ifdef DEFERRED_SHADING
uniform sampler2D depthtex;
uniform sampler2D normaltex;
uniform isampler2D idtex;
int mat_id; /* global */
#else
uniform int mat_id;
#endif
/* Aliases */
#define ssao_samples_num ssao_params.x
#define jitter_tilling ssao_params.yz
#define dfdy_sign ssao_params.w
#define matcap_hsv matcaps_param[mat_id].matcap_hsv_id.xyz
#define matcap_index matcaps_param[mat_id].matcap_hsv_id.w
#define matcap_rotation matcaps_param[mat_id].matcap_rot.xy
#ifndef DEFERRED_SHADING
# ifdef USE_FLAT_NORMAL
flat in vec3 normal;
# else
in vec3 normal;
# endif
#endif
out vec4 fragColor;
/* TODO Move this to SSAO modules */
/* simple depth reconstruction, see http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer
* we change the factors from the article to fit the OpennGL model. */
vec3 get_view_space_from_depth(in vec2 uvcoords, in float depth)
{
if (WinMatrix[3][3] == 0.0) {
/* Perspective */
float d = 2.0 * depth - 1.0;
float zview = -WinMatrix[3][2] / (d + WinMatrix[2][2]);
return zview * (viewvecs[0].xyz + vec3(uvcoords, 0.0) * viewvecs[1].xyz);
}
else {
/* Orthographic */
vec3 offset = vec3(uvcoords, depth);
return viewvecs[0].xyz + offset * viewvecs[1].xyz;
}
}
#ifdef USE_HSV
void rgb_to_hsv(vec3 rgb, out vec3 outcol)
{
float cmax, cmin, h, s, v, cdelta;
vec3 c;
cmax = max(rgb[0], max(rgb[1], rgb[2]));
cmin = min(rgb[0], min(rgb[1], rgb[2]));
cdelta = cmax - cmin;
v = cmax;
if (cmax != 0.0)
s = cdelta / cmax;
else {
s = 0.0;
h = 0.0;
}
if (s == 0.0) {
h = 0.0;
}
else {
c = (vec3(cmax, cmax, cmax) - rgb.xyz) / cdelta;
if (rgb.x == cmax) h = c[2] - c[1];
else if (rgb.y == cmax) h = 2.0 + c[0] - c[2];
else h = 4.0 + c[1] - c[0];
h /= 6.0;
if (h < 0.0)
h += 1.0;
}
outcol = vec3(h, s, v);
}
void hsv_to_rgb(vec3 hsv, out vec3 outcol)
{
float i, f, p, q, t, h, s, v;
vec3 rgb;
h = hsv[0];
s = hsv[1];
v = hsv[2];
if (s == 0.0) {
rgb = vec3(v, v, v);
}
else {
if (h == 1.0)
h = 0.0;
h *= 6.0;
i = floor(h);
f = h - i;
rgb = vec3(f, f, f);
p = v * (1.0 - s);
q = v * (1.0 - (s * f));
t = v * (1.0 - (s * (1.0 - f)));
if (i == 0.0) rgb = vec3(v, t, p);
else if (i == 1.0) rgb = vec3(q, v, p);
else if (i == 2.0) rgb = vec3(p, v, t);
else if (i == 3.0) rgb = vec3(p, q, v);
else if (i == 4.0) rgb = vec3(t, p, v);
else rgb = vec3(v, p, q);
}
outcol = rgb;
}
void hue_sat(float hue, float sat, float value, inout vec3 col)
{
vec3 hsv;
rgb_to_hsv(col, hsv);
hsv.x += hue;
hsv.x -= floor(hsv.x);
hsv.y *= sat;
hsv.y = clamp(hsv.y, 0.0, 1.0);
hsv.z *= value;
hsv.z = clamp(hsv.z, 0.0, 1.0);
hsv_to_rgb(hsv, col);
}
#endif
#ifdef USE_AO
/* Prototype */
void ssao_factors(
in float depth, in vec3 normal, in vec3 position, in vec2 screenco,
out float cavities, out float edges);
#endif
/* From http://aras-p.info/texts/CompactNormalStorage.html
* Using Method #4: Spheremap Transform */
vec3 normal_decode(vec2 enc)
{
vec2 fenc = enc * 4.0 - 2.0;
float f = dot(fenc, fenc);
float g = sqrt(1.0 - f / 4.0);
vec3 n;
n.xy = fenc*g;
n.z = 1 - f / 2;
return n;
}
vec3 shade(vec3 N, vec3 position, float depth, vec2 screenco)
{
#ifdef USE_ROTATION
/* Rotate texture coordinates */
vec2 rotY = vec2(-matcap_rotation.y, matcap_rotation.x);
vec2 texco = abs(vec2(dot(N.xy, matcap_rotation), dot(N.xy, rotY)) * .49 + 0.5);
#else
vec2 texco = abs(N.xy * .49 + 0.5);
#endif
vec3 col = texture(matcaps, vec3(texco, matcap_index)).rgb;
#ifdef USE_AO
float cavity = 0.0, edges = 0.0;
ssao_factors(depth, N, position, screenco, cavity, edges);
col *= mix(vec3(1.0), matcaps_color[int(matcap_index)].rgb, cavity);
#endif
#ifdef USE_HSV
hue_sat(matcap_hsv.x, matcap_hsv.y, matcap_hsv.z, col);
#endif
#ifdef USE_AO
/* Apply highlights after hue shift */
col *= edges + 1.0;
#endif
return col;
}
void main()
{
vec2 screenco = vec2(gl_FragCoord.xy) * invscreenres;
#ifdef DEFERRED_SHADING
ivec2 texel = ivec2(gl_FragCoord.xy);
mat_id = texelFetch(idtex, texel, 0).r;
/* early out (manual stencil test) */
if (mat_id == 0)
discard;
float depth = texelFetch(depthtex, texel, 0).r;
vec3 N = normal_decode(texelFetch(normaltex, texel, 0).rg);
/* see the prepass for explanations. */
if (mat_id < 0) {
N = -N;
}
mat_id = abs(mat_id) - 1;
#else
float depth = gl_FragCoord.z;
vec3 N = normal;
#endif
vec3 position = get_view_space_from_depth(screenco, depth);
vec3 col = shade(N, position, depth, screenco);
fragColor = vec4(col, 1.0);
}

View File

@ -1,18 +0,0 @@
in vec4 uvcoordsvar;
out vec4 fragColor;
uniform vec2 invscreenres;
uniform sampler2D colortex;
void main()
{
fragColor = vec4(FxaaPixelShader(
uvcoordsvar.st,
colortex,
invscreenres,
1.0,
0.166,
0.0833
).rgb, 1.0);
}

View File

@ -1,144 +0,0 @@
/* Material Parameters packed in an UBO */
struct Material {
vec4 one;
vec4 two;
};
layout(std140) uniform material_block {
Material shader_param[MAX_MATERIAL];
};
uniform mat4 ProjectionMatrix;
uniform sampler2DArray matcaps;
uniform int mat_id;
#define randomness shader_param[mat_id].one.x
#define matcap_index shader_param[mat_id].one.y
#define matcap_rotation shader_param[mat_id].one.zw
#define matcap_hsv shader_param[mat_id].two.xyz
in vec3 tangent;
in vec3 viewPosition;
flat in float colRand;
out vec4 fragColor;
vec3 rotate(vec3 norm, vec3 ortho, float ang)
{
return norm * cos(ang) + ortho * sin(ang);
}
void rgb_to_hsv(vec3 rgb, out vec3 outcol)
{
float cmax, cmin, h, s, v, cdelta;
vec3 c;
cmax = max(rgb[0], max(rgb[1], rgb[2]));
cmin = min(rgb[0], min(rgb[1], rgb[2]));
cdelta = cmax - cmin;
v = cmax;
if (cmax != 0.0)
s = cdelta / cmax;
else {
s = 0.0;
h = 0.0;
}
if (s == 0.0) {
h = 0.0;
}
else {
c = (vec3(cmax, cmax, cmax) - rgb.xyz) / cdelta;
if (rgb.x == cmax) h = c[2] - c[1];
else if (rgb.y == cmax) h = 2.0 + c[0] - c[2];
else h = 4.0 + c[1] - c[0];
h /= 6.0;
if (h < 0.0)
h += 1.0;
}
outcol = vec3(h, s, v);
}
void hsv_to_rgb(vec3 hsv, out vec3 outcol)
{
float i, f, p, q, t, h, s, v;
vec3 rgb;
h = hsv[0];
s = hsv[1];
v = hsv[2];
if (s == 0.0) {
rgb = vec3(v, v, v);
}
else {
if (h == 1.0)
h = 0.0;
h *= 6.0;
i = floor(h);
f = h - i;
rgb = vec3(f, f, f);
p = v * (1.0 - s);
q = v * (1.0 - (s * f));
t = v * (1.0 - (s * (1.0 - f)));
if (i == 0.0) rgb = vec3(v, t, p);
else if (i == 1.0) rgb = vec3(q, v, p);
else if (i == 2.0) rgb = vec3(p, v, t);
else if (i == 3.0) rgb = vec3(p, q, v);
else if (i == 4.0) rgb = vec3(t, p, v);
else rgb = vec3(v, p, q);
}
outcol = rgb;
}
void hue_sat(float hue, float sat, float value, inout vec3 col)
{
vec3 hsv;
rgb_to_hsv(col, hsv);
hsv.x += hue;
hsv.x -= floor(hsv.x);
hsv.y *= sat;
hsv.y = clamp(hsv.y, 0.0, 1.0);
hsv.z *= value;
hsv.z = clamp(hsv.z, 0.0, 1.0);
hsv_to_rgb(hsv, col);
}
void main()
{
vec3 viewvec = (ProjectionMatrix[3][3] == 0.0) ? normalize(viewPosition) : vec3(0.0, 0.0, -1.0);
vec3 ortho = normalize(cross(viewvec, tangent));
vec3 norm = normalize(cross(ortho, tangent));
vec3 col = vec3(0);
vec2 rotY = vec2(-matcap_rotation.y, matcap_rotation.x);
for (int i = 0; i < 9; i++) {
vec3 rotNorm = rotate(norm, ortho, -0.5 + (i * 0.125));
vec3 ray = reflect(viewvec, rotNorm);
vec2 texco = abs(vec2(dot(ray.xy, matcap_rotation), dot(ray.xy, rotY)) * .49 + 0.5);
col += texture(matcaps, vec3(texco, matcap_index)).rgb / 9.0;
}
hue_sat(matcap_hsv.x, matcap_hsv.y, matcap_hsv.z, col);
float maxChan = max(max(col.r, col.g), col.b);
col += (colRand * maxChan * randomness * 1.5) - (maxChan * randomness * 0.75);
fragColor.rgb = col;
fragColor.a = 1.0;
}

View File

@ -1,34 +0,0 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;
uniform mat4 ModelViewMatrix;
in vec3 pos;
in vec3 nor;
in int ind;
out vec3 tangent;
out vec3 viewPosition;
flat out float colRand;
float rand(int s)
{
int seed = s * 1023423;
seed = (seed ^ 61) ^ (seed >> 16);
seed *= 9;
seed = seed ^ (seed >> 4);
seed *= 0x27d4eb2d;
seed = seed ^ (seed >> 15);
float value = float(seed);
value *= 1.0 / 42596.0;
return fract(value);
}
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
tangent = normalize(NormalMatrix * nor);
viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
colRand = rand(ind);
}

View File

@ -1,44 +0,0 @@
uniform int mat_id;
#ifdef USE_FLAT_NORMAL
flat in vec3 normal;
#else
in vec3 normal;
#endif
layout(location = 0) out vec2 outNormals;
layout(location = 1) out int outIndex;
/* From http://aras-p.info/texts/CompactNormalStorage.html
* Using Method #4: Spheremap Transform */
vec2 normal_encode(vec3 n)
{
float p = sqrt(n.z * 8.0 + 8.0);
return n.xy / p + 0.5;
}
/* 4x4 bayer matrix prepared for 8bit UNORM precision error. */
#define P(x) (((x + 0.5) * (1.0 / 16.0) - 0.5) * (1.0 / 255.0))
const vec4 dither_mat[4] = vec4[4](
vec4( P(0.0), P(8.0), P(2.0), P(10.0)),
vec4(P(12.0), P(4.0), P(14.0), P(6.0)),
vec4( P(3.0), P(11.0), P(1.0), P(9.0)),
vec4(P(15.0), P(7.0), P(13.0), P(5.0))
);
void main() {
outIndex = (mat_id + 1); /* 0 is clear color */
/**
* To fix the normal buffer precision issue for backfaces,
* we invert normals and use the sign of the index buffer
* to tag them, and re-invert in deferred pass.
**/
vec3 N = (gl_FrontFacing) ? normal : -normal;
outIndex = (gl_FrontFacing) ? outIndex : -outIndex;
outNormals = normal_encode(N);
/* Dither the output to fight low quality. */
ivec2 tx = ivec2(gl_FragCoord.xy) % 4;
outNormals += dither_mat[tx.x][tx.y];
}

View File

@ -1,17 +0,0 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;
in vec3 pos;
in vec3 nor;
#ifdef USE_FLAT_NORMAL
flat out vec3 normal;
#else
out vec3 normal;
#endif
void main()
{
normal = normalize(NormalMatrix * nor);
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
}

View File

@ -1,82 +0,0 @@
#define ssao_distance matcaps_param[mat_id].ssao_params_var.x
#define ssao_factor_cavity matcaps_param[mat_id].ssao_params_var.y
#define ssao_factor_edge matcaps_param[mat_id].ssao_params_var.z
#define ssao_attenuation matcaps_param[mat_id].ssao_params_var.w
/* from The Alchemy screen-space ambient obscurance algorithm
* http://graphics.cs.williams.edu/papers/AlchemyHPG11/VV11AlchemyAO.pdf */
void ssao_factors(
in float depth, in vec3 normal, in vec3 position, in vec2 screenco,
out float cavities, out float edges)
{
cavities = edges = 0.0;
/* early out if there is no need for SSAO */
if (ssao_factor_cavity == 0.0 && ssao_factor_edge == 0.0)
return;
/* take the normalized ray direction here */
vec3 noise = texture(ssao_jitter, screenco.xy * jitter_tilling).rgb;
/* find the offset in screen space by multiplying a point
* in camera space at the depth of the point by the projection matrix. */
vec2 offset;
float homcoord = WinMatrix[2][3] * position.z + WinMatrix[3][3];
offset.x = WinMatrix[0][0] * ssao_distance / homcoord;
offset.y = WinMatrix[1][1] * ssao_distance / homcoord;
/* convert from -1.0...1.0 range to 0.0..1.0 for easy use with texture coordinates */
offset *= 0.5;
int num_samples = int(ssao_samples_num);
/* Note. Putting noise usage here to put some ALU after texture fetch. */
vec2 rotX = noise.rg;
vec2 rotY = vec2(-rotX.y, rotX.x);
for (int x = 0; x < num_samples && x < 500; x++) {
/* ssao_samples[x].xy is sample direction (normalized).
* ssao_samples[x].z is sample distance from disk center. */
/* Rotate with random direction to get jittered result. */
vec2 dir_jittered = vec2(dot(ssao_samples[x].xy, rotX), dot(ssao_samples[x].xy, rotY));
dir_jittered.xy *= ssao_samples[x].z + noise.b;
vec2 uvcoords = screenco.xy + dir_jittered * offset;
if (uvcoords.x > 1.0 || uvcoords.x < 0.0 || uvcoords.y > 1.0 || uvcoords.y < 0.0)
continue;
float depth_new = texture(depthtex, uvcoords).r;
/* Handle Background case */
bool is_background = (depth_new == 1.0);
/* This trick provide good edge effect even if no neighboor is found. */
vec3 pos_new = get_view_space_from_depth(uvcoords, (is_background) ? depth : depth_new);
if (is_background)
pos_new.z -= ssao_distance;
vec3 dir = pos_new - position;
float len = length(dir);
float f_cavities = dot(dir, normal);
float f_edge = -f_cavities;
float f_bias = 0.05 * len + 0.0001;
float attenuation = 1.0 / (len * (1.0 + len * len * ssao_attenuation));
/* use minor bias here to avoid self shadowing */
if (f_cavities > -f_bias)
cavities += f_cavities * attenuation;
if (f_edge > f_bias)
edges += f_edge * attenuation;
}
cavities /= ssao_samples_num;
edges /= ssao_samples_num;
/* don't let cavity wash out the surface appearance */
cavities = clamp(cavities * ssao_factor_cavity, 0.0, 1.0);
edges = edges * ssao_factor_edge;
}

View File

@ -1,122 +0,0 @@
#define ssao_distance matcaps_param[mat_id].ssao_params_var.x
#define ssao_factor_cavity matcaps_param[mat_id].ssao_params_var.y
#define ssao_factor_edge matcaps_param[mat_id].ssao_params_var.z
#define ssao_attenuation matcaps_param[mat_id].ssao_params_var.w
/* Based on Practical Realtime Strategies for Accurate Indirect Occlusion
* http://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf
* http://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pptx */
#define COSINE_WEIGHTING
float integrate_arc(in float h1, in float h2, in float gamma, in float n_proj_len)
{
float a = 0.0;
#ifdef COSINE_WEIGHTING
float cos_gamma = cos(gamma);
float sin_gamma_2 = 2.0 * sin(gamma);
a += -cos(2.0 * h1 - gamma) + cos_gamma + h1 * sin_gamma_2;
a += -cos(2.0 * h2 - gamma) + cos_gamma + h2 * sin_gamma_2;
a *= 0.25; /* 1/4 */
a *= n_proj_len;
#else
/* Uniform weighting (slide 59) */
a += 1 - cos(h1);
a += 1 - cos(h2);
#endif
return a;
}
float get_max_horizon(in vec2 co, in vec3 x, in vec3 omega_o, in float h)
{
if (co.x > 1.0 || co.x < 0.0 || co.y > 1.0 || co.y < 0.0)
return h;
float depth = texture(depthtex, co).r;
/* Background case */
if (depth == 1.0)
return h;
vec3 s = get_view_space_from_depth(co, depth); /* s View coordinate */
vec3 omega_s = s - x;
float len = length(omega_s);
if (len < ssao_distance) {
omega_s /= len;
h = max(h, dot(omega_s, omega_o));
}
return h;
}
void ssao_factors(
in float depth, in vec3 normal, in vec3 position, in vec2 screenco,
out float cavities, out float edges)
{
/* Renaming */
vec3 omega_o = -normalize(position); /* viewvec */
vec2 x_ = screenco; /* x^ Screen coordinate */
vec3 x = position; /* x view space coordinate */
#ifdef SPATIAL_DENOISE
float noise_dir = (1.0 / 16.0) * float(((int(gl_FragCoord.x + gl_FragCoord.y) & 0x3) << 2) + (int(gl_FragCoord.x) & 0x3));
float noise_offset = (1.0 / 4.0) * float(int(gl_FragCoord.y - gl_FragCoord.x) & 0x3);
#else
float noise_dir = (1.0 / 16.0) * float(((int(gl_FragCoord.x + gl_FragCoord.y) & 0x3) << 2) + (int(gl_FragCoord.x) & 0x3));
float noise_offset = (0.5 / 16.0) + (1.0 / 16.0) * float(((int(gl_FragCoord.x - gl_FragCoord.y) & 0x3) << 2) + (int(gl_FragCoord.x) & 0x3));
#endif
const float phi_step = 16.0;
const float theta_step = 16.0;
const float m_pi = 3.14159265358979323846;
vec2 pixel_ratio = vec2(screenres.y / screenres.x, 1.0);
vec2 pixel_size = vec2(1.0) / screenres.xy;
float min_stride = length(pixel_size);
float homcco = WinMatrix[2][3] * position.z + WinMatrix[3][3];
float n = max(min_stride * theta_step, ssao_distance / homcco); /* Search distance */
/* Integral over PI */
float A = 0.0;
for (float i = 0.0; i < phi_step; i++) {
float phi = m_pi * ((noise_dir + i) / phi_step);
vec2 t_phi = vec2(cos(phi), sin(phi)); /* Screen space direction */
/* Search maximum horizon angles Theta1 and Theta2 */
float theta1 = -1.0, theta2 = -1.0; /* init at cos(pi) */
for (float j = 0.0; j < theta_step; j++) {
vec2 s_ = t_phi * pixel_ratio * n * ((j + noise_offset)/ theta_step); /* s^ Screen coordinate */
vec2 co;
co = x_ + s_;
theta1 = get_max_horizon(co, x, omega_o, theta1);
co = x_ - s_;
theta2 = get_max_horizon(co, x, omega_o, theta2);
}
/* (Slide 54) */
theta1 = -acos(theta1);
theta2 = acos(theta2);
/* Projecting Normal to Plane P defined by t_phi and omega_o */
vec3 h = normalize(cross(vec3(t_phi, 0.0), omega_o)); /* Normal vector to Integration plane */
vec3 t = cross(h, omega_o); /* Normal vector to plane */
vec3 n_proj = normal - h * dot(normal, h);
float n_proj_len = length(n_proj);
vec3 n_proj_norm = normalize(n_proj);
/* Clamping thetas (slide 58) */
float gamma = sign(dot(n_proj_norm, t)) * acos(dot(normal, omega_o)); /* Angle between view vec and normal */
theta1 = gamma + max(theta1 - gamma, -m_pi * 0.5);
theta2 = gamma + min(theta2 - gamma, m_pi * 0.5);
/* Solving inner integral */
A += integrate_arc(theta1, theta2, gamma, n_proj_len);
}
A /= phi_step;
cavities = 1.0 - A;
edges = 0.0;
}

View File

@ -76,7 +76,6 @@
#include "draw_cache_impl.h"
#include "draw_mode_engines.h"
#include "engines/clay/clay_engine.h"
#include "engines/eevee/eevee_engine.h"
#include "engines/basic/basic_engine.h"
#include "engines/workbench/workbench_engine.h"
@ -2068,9 +2067,6 @@ void DRW_engine_register(DrawEngineType *draw_engine_type)
void DRW_engines_register(void)
{
#ifdef WITH_CLAY_ENGINE
RE_engines_register(&DRW_engine_viewport_clay_type);
#endif
RE_engines_register(&DRW_engine_viewport_eevee_type);
RE_engines_register(&DRW_engine_viewport_workbench_type);
@ -2165,10 +2161,6 @@ void DRW_engines_free(void)
MEM_SAFE_FREE(DST.RST.bound_ubo_slots);
DRW_opengl_context_disable();
#ifdef WITH_CLAY_ENGINE
BLI_remlink(&R_engines, &DRW_engine_viewport_clay_type);
#endif
}
/** \} */

View File

@ -681,32 +681,6 @@ if(WITH_BLENDER)
data_to_c_simple(../../../../release/datafiles/brushicons/twist.png SRC)
data_to_c_simple(../../../../release/datafiles/brushicons/vertexdraw.png SRC)
# matcap
data_to_c_simple(../../../../release/datafiles/matcaps/mc01.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc02.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc03.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc04.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc05.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc06.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc07.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc08.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc09.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc10.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc11.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc12.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc13.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc14.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc15.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc16.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc17.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc18.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc19.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc20.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc21.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc22.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc23.jpg SRC)
data_to_c_simple(../../../../release/datafiles/matcaps/mc24.jpg SRC)
endif()
data_to_c_simple(../../../../release/datafiles/startup.blend SRC)

View File

@ -451,49 +451,6 @@ static void icon_verify_datatoc(IconImage *iimg)
}
}
static void init_matcap_icons(void)
{
/* dynamic allocation now, tucking datatoc pointers in DrawInfo */
#define INIT_MATCAP_ICON(icon_id, name) \
{ \
unsigned char *rect = (unsigned char *)datatoc_ ##name## _jpg; \
int size = datatoc_ ##name## _jpg_size; \
DrawInfo *di; \
\
di = def_internal_icon(NULL, icon_id, 0, 0, 96, ICON_TYPE_BUFFER); \
di->data.buffer.image->datatoc_rect = rect; \
di->data.buffer.image->datatoc_size = size; \
} (void)0
INIT_MATCAP_ICON(ICON_MATCAP_01, mc01);
INIT_MATCAP_ICON(ICON_MATCAP_02, mc02);
INIT_MATCAP_ICON(ICON_MATCAP_03, mc03);
INIT_MATCAP_ICON(ICON_MATCAP_04, mc04);
INIT_MATCAP_ICON(ICON_MATCAP_05, mc05);
INIT_MATCAP_ICON(ICON_MATCAP_06, mc06);
INIT_MATCAP_ICON(ICON_MATCAP_07, mc07);
INIT_MATCAP_ICON(ICON_MATCAP_08, mc08);
INIT_MATCAP_ICON(ICON_MATCAP_09, mc09);
INIT_MATCAP_ICON(ICON_MATCAP_10, mc10);
INIT_MATCAP_ICON(ICON_MATCAP_11, mc11);
INIT_MATCAP_ICON(ICON_MATCAP_12, mc12);
INIT_MATCAP_ICON(ICON_MATCAP_13, mc13);
INIT_MATCAP_ICON(ICON_MATCAP_14, mc14);
INIT_MATCAP_ICON(ICON_MATCAP_15, mc15);
INIT_MATCAP_ICON(ICON_MATCAP_16, mc16);
INIT_MATCAP_ICON(ICON_MATCAP_17, mc17);
INIT_MATCAP_ICON(ICON_MATCAP_18, mc18);
INIT_MATCAP_ICON(ICON_MATCAP_19, mc19);
INIT_MATCAP_ICON(ICON_MATCAP_20, mc20);
INIT_MATCAP_ICON(ICON_MATCAP_21, mc21);
INIT_MATCAP_ICON(ICON_MATCAP_22, mc22);
INIT_MATCAP_ICON(ICON_MATCAP_23, mc23);
INIT_MATCAP_ICON(ICON_MATCAP_24, mc24);
#undef INIT_MATCAP_ICON
}
static void init_internal_icons(void)
{
// bTheme *btheme = UI_GetTheme();
@ -850,7 +807,6 @@ void UI_icons_init(int first_dyn_id)
init_iconfile_list(&iconfilelist);
init_internal_icons();
init_brush_icons();
init_matcap_icons();
#endif
}

View File

@ -54,16 +54,6 @@ typedef struct TexPaintSlot {
int pad;
} TexPaintSlot;
/* Clay engine */
/* MaterialRuntimeClay.flag */
#define CLAY_OUTDATED 1
/* MaterialEngineSettingsClay.type */
#define CLAY_MATCAP_NONE 0
#define CLAY_MATCAP_SIMPLE 1
#define CLAY_MATCAP_COMPLETE 2
typedef struct Material {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */

View File

@ -1372,19 +1372,11 @@ typedef struct SceneDisplay {
float light_direction[3]; /* light direction for shadows/highlight */
float shadow_shift;
int matcap_icon;
int matcap_type;
float matcap_rotation;
float matcap_hue;
float matcap_saturation;
float matcap_value;
/* Settings for Cavity Shader */
float matcap_ssao_distance;
float matcap_ssao_attenuation;
float matcap_ssao_factor_cavity;
float matcap_ssao_factor_edge;
float matcap_hair_brightness_randomness;
int matcap_ssao_samples;
int pad;
} SceneDisplay;
typedef struct SceneEEVEE {
@ -1704,7 +1696,6 @@ enum {
/* sequencer seq_prev_type seq_rend_type */
/* RenderData.engine (scene.c) */
extern const char *RE_engine_id_BLENDER_CLAY;
extern const char *RE_engine_id_BLENDER_EEVEE;
extern const char *RE_engine_id_BLENDER_WORKBENCH;
extern const char *RE_engine_id_CYCLES;

View File

@ -187,10 +187,6 @@ if(WITH_PYTHON)
)
endif()
if(WITH_CLAY_ENGINE)
add_definitions(-DWITH_CLAY_ENGINE)
endif()
if(WITH_IMAGE_OPENEXR)
add_definitions(-DWITH_OPENEXR)
endif()

View File

@ -5673,36 +5673,6 @@ static void rna_def_scene_display(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
#ifdef WITH_CLAY_ENGINE
static const EnumPropertyItem clay_matcap_items[] = {
{1, "01", ICON_MATCAP_01, "", ""},
{2, "02", ICON_MATCAP_02, "", ""},
{3, "03", ICON_MATCAP_03, "", ""},
{4, "04", ICON_MATCAP_04, "", ""},
{5, "05", ICON_MATCAP_05, "", ""},
{6, "06", ICON_MATCAP_06, "", ""},
{7, "07", ICON_MATCAP_07, "", ""},
{8, "08", ICON_MATCAP_08, "", ""},
{9, "09", ICON_MATCAP_09, "", ""},
{10, "10", ICON_MATCAP_10, "", ""},
{11, "11", ICON_MATCAP_11, "", ""},
{12, "12", ICON_MATCAP_12, "", ""},
{13, "13", ICON_MATCAP_13, "", ""},
{14, "14", ICON_MATCAP_14, "", ""},
{15, "15", ICON_MATCAP_15, "", ""},
{16, "16", ICON_MATCAP_16, "", ""},
{17, "17", ICON_MATCAP_17, "", ""},
{19, "18", ICON_MATCAP_18, "", ""},
{19, "19", ICON_MATCAP_19, "", ""},
{20, "20", ICON_MATCAP_20, "", ""},
{21, "21", ICON_MATCAP_21, "", ""},
{22, "22", ICON_MATCAP_22, "", ""},
{23, "23", ICON_MATCAP_23, "", ""},
{24, "24", ICON_MATCAP_24, "", ""},
{0, NULL, 0, NULL, NULL}
};
#endif
static float default_light_direction[3] = {-M_SQRT1_3, -M_SQRT1_3, M_SQRT1_3};
srna = RNA_def_struct(brna, "SceneDisplay", NULL);
@ -5726,43 +5696,6 @@ static void rna_def_scene_display(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
#ifdef WITH_CLAY_ENGINE
/* Matcap. */
prop = RNA_def_property(srna, "matcap_icon", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, clay_matcap_items);
RNA_def_property_enum_default(prop, 1);
RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture by this material");
prop = RNA_def_property(srna, "matcap_rotation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Rotation", "Orientation of the matcap on the model");
prop = RNA_def_property(srna, "matcap_hue", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Hue Shift", "Hue correction of the matcap");
prop = RNA_def_property(srna, "matcap_saturation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Saturation", "Saturation correction of the matcap");
prop = RNA_def_property(srna, "matcap_value", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Value", "Value correction of the matcap");
prop = RNA_def_property(srna, "matcap_ssao_factor_cavity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Cavity Strength", "Strength of the Cavity effect");
RNA_def_property_range(prop, 0.0f, 250.0f);
prop = RNA_def_property(srna, "matcap_ssao_factor_edge", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Edge Strength", "Strength of the Edge effect");
RNA_def_property_range(prop, 0.0f, 250.0f);
prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 0.2f);
RNA_def_property_ui_text(prop, "Distance", "Distance of object that contribute to the Cavity/Edge effect");
@ -5779,12 +5712,6 @@ static void rna_def_scene_display(BlenderRNA *brna)
RNA_def_property_int_default(prop, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of samples");
RNA_def_property_range(prop, 1, 500);
prop = RNA_def_property(srna, "matcap_hair_brightness_randomness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_ui_text(prop, "Hair Brightness Randomness", "Brightness randomness for hair");
RNA_def_property_range(prop, 0.0f, 1.0f);
#endif
}
static void rna_def_scene_eevee(BlenderRNA *brna)

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct

View File

@ -14,6 +14,7 @@ from view_layer_common import *
# ############################################################
class UnitTesting(ViewLayerTesting):
@unittest.skip("Uses the clay engine, that is removed T55454")
def test_render_settings(self):
"""
See if the depsgraph evaluation is correct