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.
2 changed files with 72 additions and 34 deletions
Showing only changes of commit 6389c9a31a - Show all commits

View File

@ -18,7 +18,7 @@ class StormHydraRenderEngine(bpy.types.HydraRenderEngine):
def get_render_settings(self, engine_type):
settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \
bpy.context.scene.hydra_storm.final
return {
result = {
'enableTinyPrimCulling': settings.enable_tiny_prim_culling,
'volumeRaymarchingStepSize': settings.volume_raymarching_step_size,
'volumeRaymarchingStepSizeLighting': settings.volume_raymarching_step_size_lighting,
@ -26,6 +26,18 @@ class StormHydraRenderEngine(bpy.types.HydraRenderEngine):
'maxLights': settings.max_lights,
}
if engine_type == 'FINAL':
result |= {
'aovToken:Combined': "color",
'aovToken:Depth': "depth",
}
return result
def update_render_passes(self, scene, render_layer):
if render_layer.use_pass_z:
self.register_pass(scene, render_layer, 'Depth', 1, 'Z', 'VALUE')
register, unregister = bpy.utils.register_classes_factory((
StormHydraRenderEngine,

View File

@ -95,6 +95,60 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
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):
"""Physical light sources"""
bl_idname = 'STORM_HYDRA_LIGHT_PT_light'
@ -149,21 +203,7 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
main_col.prop(light, '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_light_shadows(Panel):
class STORM_HYDRA_LIGHT_PT_shadows(Panel):
bl_parent_id = STORM_HYDRA_LIGHT_PT_light.bl_idname
bl_label = "Shadow"
bl_space_type = 'PROPERTIES'
@ -196,31 +236,17 @@ class STORM_HYDRA_RENDER_PT_light_shadows(Panel):
col.prop(light, "shadow_cascade_fade", text="Fade")
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")
register_classes, unregister_classes = bpy.utils.register_classes_factory((
STORM_HYDRA_RENDER_PT_final,
STORM_HYDRA_RENDER_PT_volume_final,
STORM_HYDRA_RENDER_PT_viewport,
STORM_HYDRA_RENDER_PT_volume_viewport,
STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_RENDER_PT_shadows,
STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_RENDER_PT_passes,
STORM_HYDRA_RENDER_PT_passes_data,
STORM_HYDRA_LIGHT_PT_light,
STORM_HYDRA_RENDER_PT_light_shadows,
STORM_HYDRA_LIGHT_PT_shadows,
))