WIP Make shadows visible for Storm delegate #26

Closed
Vasyl Pidhirskyi wants to merge 2 commits from BLEND-469 into storm-hydra-addon

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

View File

@ -6,7 +6,6 @@
import bpy import bpy
from .engine import StormHydraRenderEngine from .engine import StormHydraRenderEngine
from .preferences import addon_preferences
class Panel(bpy.types.Panel): class Panel(bpy.types.Panel):
@ -96,8 +95,63 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
col.prop(settings, "volume_max_texture_memory_per_field") col.prop(settings, "volume_max_texture_memory_per_field")
class STORM_HYDRA_RENDER_PT_shadows(Panel):
bl_label = "Shadows"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
props = context.scene.eevee
col = layout.column()
col.prop(props, "shadow_cascade_size", text="Cascade Size")
class STORM_HYDRA_RENDER_PT_film(Panel):
bl_label = "Film"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
layout.prop(context.scene.render, "film_transparent", text="Transparent Background")
class STORM_HYDRA_RENDER_PT_passes(Panel):
bl_label = "Passes"
bl_context = "view_layer"
def draw(self, context):
pass
class STORM_HYDRA_RENDER_PT_passes_data(Panel):
bl_label = "Data"
bl_context = "view_layer"
bl_parent_id = "STORM_HYDRA_RENDER_PT_passes"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
view_layer = context.view_layer
col = layout.column(heading="Include", align=True)
col.prop(view_layer, "use_pass_z")
class STORM_HYDRA_LIGHT_PT_light(Panel): class STORM_HYDRA_LIGHT_PT_light(Panel):
"""Physical light sources""" """Physical light sources"""
bl_idname = 'STORM_HYDRA_LIGHT_PT_light'
bl_label = "Light" bl_label = "Light"
bl_context = 'data' bl_context = 'data'
@ -149,42 +203,37 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
main_col.prop(light, 'size') main_col.prop(light, 'size')
class STORM_HYDRA_RENDER_PT_film(Panel): class STORM_HYDRA_LIGHT_PT_shadows(Panel):
bl_label = "Film" bl_parent_id = STORM_HYDRA_LIGHT_PT_light.bl_idname
bl_label = "Shadow"
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
def draw(self, context): @classmethod
layout = self.layout def poll(cls, context):
layout.use_property_split = True light = context.light
layout.use_property_decorate = False return (
(light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'})
)
layout.prop(context.scene.render, "film_transparent", text="Transparent Background") def draw_header(self, context):
light = context.light
self.layout.prop(light, "use_shadow", text="")
class STORM_HYDRA_RENDER_PT_passes(Panel):
bl_label = "Passes"
bl_context = "view_layer"
def draw(self, context):
pass
class STORM_HYDRA_RENDER_PT_passes_data(Panel):
bl_label = "Data"
bl_context = "view_layer"
bl_parent_id = "STORM_HYDRA_RENDER_PT_passes"
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False
view_layer = context.view_layer light = context.light
col = layout.column(heading="Include", align=True) layout.active = light.use_shadow
col.prop(view_layer, "use_pass_z")
if light.type == 'SUN':
col = layout.column()
col.prop(light, "shadow_buffer_bias", text="Bias")
col.prop(light, "shadow_cascade_max_distance", text="Max Distance")
col.prop(light, "shadow_cascade_fade", text="Fade")
register_classes, unregister_classes = bpy.utils.register_classes_factory(( register_classes, unregister_classes = bpy.utils.register_classes_factory((
@ -192,10 +241,12 @@ register_classes, unregister_classes = bpy.utils.register_classes_factory((
STORM_HYDRA_RENDER_PT_volume_final, STORM_HYDRA_RENDER_PT_volume_final,
STORM_HYDRA_RENDER_PT_viewport, STORM_HYDRA_RENDER_PT_viewport,
STORM_HYDRA_RENDER_PT_volume_viewport, STORM_HYDRA_RENDER_PT_volume_viewport,
STORM_HYDRA_RENDER_PT_shadows,
STORM_HYDRA_RENDER_PT_film, STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_LIGHT_PT_light,
STORM_HYDRA_RENDER_PT_passes, STORM_HYDRA_RENDER_PT_passes,
STORM_HYDRA_RENDER_PT_passes_data, STORM_HYDRA_RENDER_PT_passes_data,
STORM_HYDRA_LIGHT_PT_light,
STORM_HYDRA_LIGHT_PT_shadows,
)) ))