Storm Hydra render addon #104597

Merged
Brecht Van Lommel merged 22 commits from BogdanNagirniak/blender-addons:storm-hydra-addon into main 2023-08-04 17:02:11 +02:00
7 changed files with 111 additions and 99 deletions
Showing only changes of commit 163daadfdf - Show all commits

View File

@ -5,18 +5,17 @@
bl_info = { bl_info = {
"name": "Hydra render engine: Storm", "name": "Hydra Storm render engine",
"author": "AMD", "author": "AMD",
"version": (1, 0, 0), "version": (1, 0, 0),
"blender": (3, 5, 0), "blender": (3, 5, 0),
"location": "Info header > Render engine menu", "description": "USD's high performance rasterizing renderer",
"description": "Storm GL delegate for Hydra render engine",
"tracker_url": "", "tracker_url": "",
brecht marked this conversation as resolved

"GL" is not accurate for Metal and Vulkan.

I'm also not sure "Storm GL delegate for Hydra render engine" means.

"GL" is not accurate for Metal and Vulkan. I'm also not sure "Storm GL delegate for Hydra render engine" means.
"doc_url": "", "doc_url": "",
"community": "", "community": "",
"downloads": "", "downloads": "",
"main_web": "", "main_web": "",
"support": 'TESTING', "support": 'OFFICIAL',
"category": "Render" "category": "Render"
brecht marked this conversation as resolved

TESTING -> OFFICIAL

TESTING -> OFFICIAL
} }

View File

@ -11,22 +11,17 @@ import bpy_hydra
class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
bl_idname = 'StormHydraRenderEngine' bl_idname = 'StormHydraRenderEngine'
bl_label = "Hydra: Storm" bl_label = "Hydra Storm"
bl_info = "Hydra Storm (OpenGL) render delegate" bl_info = "USD's high performance rasterizing renderer"
bl_use_preview = False bl_use_preview = False
bl_use_gpu_context = True bl_use_gpu_context = True
delegate_id = 'HdStormRendererPlugin' delegate_id = 'HdStormRendererPlugin'
@classmethod
def register(cls):
super().register()
bpy_hydra.register_plugins([str(Path(__file__).parent / "plugin")])
def get_render_settings(self, engine_type): def get_render_settings(self, engine_type):
settings = bpy.context.scene.hydra_storm settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \
bpy.context.scene.hydra_storm.final
return { return {
'enableTinyPrimCulling': settings.enable_tiny_prim_culling, 'enableTinyPrimCulling': settings.enable_tiny_prim_culling,
'volumeRaymarchingStepSize': settings.volume_raymarching_step_size, 'volumeRaymarchingStepSize': settings.volume_raymarching_step_size,

View File

@ -1,3 +0,0 @@
{
"Includes": [ "usd/*/resources/" ]
}

View File

@ -1,22 +0,0 @@
{
"Plugins": [
{
"Info": {
"Types": {
"HdStormRendererPlugin": {
"bases": [
"HdRendererPlugin"
],
"displayName": "GL",
"priority": 0
}
}
},
"LibraryPath": "",
"Name": "hdStorm",
"ResourcePath": "resources",
"Root": "..",
"Type": "library"
}
]
}

View File

@ -1,3 +0,0 @@
{
"Includes": [ "*/resources/" ]
}

View File

@ -7,11 +7,11 @@ import bpy
class Properties(bpy.types.PropertyGroup): class Properties(bpy.types.PropertyGroup):
bl_type = None type = None
@classmethod @classmethod
def register(cls): def register(cls):
cls.bl_type.hydra_storm = bpy.props.PointerProperty( cls.type.hydra_storm = bpy.props.PointerProperty(
name="Hydra Storm", name="Hydra Storm",
description="Hydra Storm properties", description="Hydra Storm properties",
type=cls, type=cls,
@ -19,12 +19,10 @@ class Properties(bpy.types.PropertyGroup):
@classmethod @classmethod
def unregister(cls): def unregister(cls):
del cls.bl_type.hydra_storm del cls.type.hydra_storm
class SceneProperties(Properties): class RenderProperties(bpy.types.PropertyGroup):
bl_type = bpy.types.Scene
enable_tiny_prim_culling: bpy.props.BoolProperty( enable_tiny_prim_culling: bpy.props.BoolProperty(
name="Tiny Prim Culling", name="Tiny Prim Culling",
description="Enable Tiny Prim Culling", description="Enable Tiny Prim Culling",
@ -36,22 +34,30 @@ class SceneProperties(Properties):
default=1.0, default=1.0,
) )
volume_raymarching_step_size_lighting: bpy.props.FloatProperty( volume_raymarching_step_size_lighting: bpy.props.FloatProperty(
name="Volume Raymarching Step Size", name="Volume Raymarching Step Size Lighting",
description="Step size when raymarching volume for lighting computation", description="Step size when raymarching volume for lighting computation",
default=10.0, default=10.0,
brecht marked this conversation as resolved

This is name should not be identical to the one for volume_raymarching_step_size

This is name should not be identical to the one for volume_raymarching_step_size
) )
volume_max_texture_memory_per_field: bpy.props.FloatProperty( volume_max_texture_memory_per_field: bpy.props.FloatProperty(
name="Volume Max Texture Memory Per Field", name="Max Texture Memory Per Field",
description="Maximum memory for a volume field texture in Mb (unless overridden by field prim)", description="Maximum memory for a volume field texture in Mb (unless overridden by field prim)",
default=128.0, default=128.0,
) )
max_lights: bpy.props.IntProperty( max_lights: bpy.props.IntProperty(
name="Max Lights", name="Max Lights",
description="Maximum number of lights", description="Limit maximum number of lights",
default=16, min=0, default=16, min=0, max=16,
) )
brecht marked this conversation as resolved

What happens when the maximum is reach? Why is the default only 16? This needs a better explanation in the description.

What happens when the maximum is reach? Why is the default only 16? This needs a better explanation in the description.
Review
It comes from source code https://github.com/PixarAnimationStudios/USD/blob/release/pxr/imaging/hdSt/renderDelegate.cpp#L70

Can you figure out what it does so it can be explained in the description for users?

Can you figure out what it does so it can be explained in the description for users?
class SceneProperties(Properties):
type = bpy.types.Scene
final: bpy.props.PointerProperty(type=RenderProperties)
viewport: bpy.props.PointerProperty(type=RenderProperties)
register, unregister = bpy.utils.register_classes_factory(( register, unregister = bpy.utils.register_classes_factory((
RenderProperties,
SceneProperties, SceneProperties,
)) ))

View File

@ -19,20 +19,94 @@ class Panel(bpy.types.Panel):
return context.engine in cls.COMPAT_ENGINES return context.engine in cls.COMPAT_ENGINES
class STORM_HYDRA_RENDER_PT_render_settings(Panel): #
# FINAL RENDER SETTINGS
#
class STORM_HYDRA_RENDER_PT_final(Panel):
"""Final render delegate and settings""" """Final render delegate and settings"""
bl_label = "Storm Render Settings" bl_idname = 'STORM_HYDRA_RENDER_PT_final'
bl_label = "Storm Final Settings"
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 layout.use_property_decorate = False
settings = context.scene.hydra_storm settings = context.scene.hydra_storm.final
layout.prop(settings, 'enable_tiny_prim_culling') layout.prop(settings, 'enable_tiny_prim_culling')
layout.prop(settings, 'max_lights') layout.prop(settings, 'max_lights')
class FinalPanel(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_final.bl_idname
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def settings(self, context):
return context.scene.hydra_storm.final
class STORM_HYDRA_RENDER_PT_volume_final(FinalPanel):
bl_label = "Volume Raymarching"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.settings(context)
col = layout.column(align=True)
col.prop(settings, "volume_raymarching_step_size", text="Step Size")
col.prop(settings, "volume_raymarching_step_size_lighting", text="Step Size Lightning")
col.prop(settings, "volume_max_texture_memory_per_field")
#
# VIEWPORT RENDER SETTINGS
#
class STORM_HYDRA_RENDER_PT_viewport(Panel):
"""Viewport render delegate and settings"""
bl_idname = 'STORM_HYDRA_RENDER_PT_viewport'
bl_label = "Storm Viewport Settings"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = context.scene.hydra_storm.viewport
layout.prop(settings, 'enable_tiny_prim_culling')
layout.prop(settings, 'max_lights')
class ViewportPanel(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_viewport.bl_idname
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def settings(self, context):
return context.scene.hydra_storm.viewport
class STORM_HYDRA_RENDER_PT_volume_viewport(ViewportPanel):
bl_label = "Volume Raymarching"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.settings(context)
col = layout.column(align=True)
col.prop(settings, "volume_raymarching_step_size", text="Step Size")
col.prop(settings, "volume_raymarching_step_size_lighting", text="Step Size Lightning")
col.prop(settings, "volume_max_texture_memory_per_field")
class STORM_HYDRA_LIGHT_PT_light(Panel): class STORM_HYDRA_LIGHT_PT_light(Panel):
""" """
Physical light sources Physical light sources
@ -89,7 +163,10 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
register_classes, unregister_classes = bpy.utils.register_classes_factory(( register_classes, unregister_classes = bpy.utils.register_classes_factory((
STORM_HYDRA_RENDER_PT_render_settings, STORM_HYDRA_RENDER_PT_final,
STORM_HYDRA_RENDER_PT_volume_final,
STORM_HYDRA_RENDER_PT_viewport,
STORM_HYDRA_RENDER_PT_volume_viewport,
STORM_HYDRA_LIGHT_PT_light, STORM_HYDRA_LIGHT_PT_light,
)) ))
@ -98,52 +175,15 @@ register_classes, unregister_classes = bpy.utils.register_classes_factory((
def get_panels(): def get_panels():
# follow the Cycles model of excluding panels we don't want # follow the Cycles model of excluding panels we don't want
exclude_panels = { exclude_panels = {
'DATA_PT_area',
'DATA_PT_falloff_curve',
'DATA_PT_shadow',
'DATA_PT_spot',
'DATA_PT_sunsky',
'DATA_PT_light',
'MATERIAL_PT_diffuse',
'MATERIAL_PT_flare',
'MATERIAL_PT_halo',
'MATERIAL_PT_mirror',
'MATERIAL_PT_options',
'MATERIAL_PT_pipeline',
'MATERIAL_PT_shading',
'MATERIAL_PT_shadow',
'MATERIAL_PT_specular',
'MATERIAL_PT_sss',
'MATERIAL_PT_strand',
'MATERIAL_PT_transp',
'MATERIAL_PT_volume_density',
'MATERIAL_PT_volume_integration',
'MATERIAL_PT_volume_lighting',
'MATERIAL_PT_volume_options',
'MATERIAL_PT_volume_shading',
'MATERIAL_PT_volume_transp',
'RENDERLAYER_PT_layer_options',
'RENDERLAYER_PT_layer_passes',
'RENDERLAYER_PT_views',
'RENDER_PT_antialiasing',
'RENDER_PT_bake',
'RENDER_PT_motion_blur',
'RENDER_PT_performance',
'RENDER_PT_freestyle',
'RENDER_PT_post_processing',
'RENDER_PT_shading',
'RENDER_PT_simplify',
'RENDER_PT_stamp', 'RENDER_PT_stamp',
'SCENE_PT_simplify', 'DATA_PT_light',
'SCENE_PT_audio', 'DATA_PT_spot',
'WORLD_PT_ambient_occlusion',
'WORLD_PT_environment_lighting',
'WORLD_PT_gather',
'WORLD_PT_indirect_lighting',
'WORLD_PT_mist',
'WORLD_PT_preview',
'WORLD_PT_world',
'NODE_DATA_PT_light', 'NODE_DATA_PT_light',
'DATA_PT_falloff_curve',
'RENDER_PT_post_processing',
'RENDER_PT_simplify',
'SCENE_PT_audio',
'RENDER_PT_freestyle'
} }
include_eevee_panels = { include_eevee_panels = {
'MATERIAL_PT_preview', 'MATERIAL_PT_preview',