diff options
Diffstat (limited to 'intern/cycles/blender/addon/properties.py')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 157 |
1 files changed, 84 insertions, 73 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 1635afab210..45d25720aff 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -55,8 +55,7 @@ enum_displacement_methods = ( enum_bvh_layouts = ( ('BVH2', "BVH2", "", 1), - ('BVH4', "BVH4", "", 2), - ('BVH8', "BVH8", "", 4), + ('EMBREE', "Embree", "", 4), ) enum_bvh_types = ( @@ -78,20 +77,9 @@ enum_panorama_types = ( ('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"), ) -enum_curve_primitives = ( - ('TRIANGLES', "Triangles", "Create triangle geometry around strands"), - ('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"), - ('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"), -) - -enum_triangle_curves = ( - ('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"), - ('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"), -) - enum_curve_shape = ( - ('RIBBONS', "Ribbons", "Ignore thickness of each strand"), - ('THICK', "Thick", "Use thickness of strand when rendering"), + ('RIBBONS', "Rounded Ribbons", "Render hair as flat ribbon with rounded normals, for fast rendering"), + ('THICK', "3D Curves", "Render hair as 3D curve, for accurate results when viewing hair close up"), ) enum_tile_order = ( @@ -194,17 +182,50 @@ enum_aov_types = ( ('COLOR', "Color", "Write a Color pass", 1), ) -enum_viewport_denoising = ( - ('NONE', "None", "Disable viewport denoising", 0), - ('OPTIX', "OptiX AI-Accelerated", "Use the OptiX denoiser running on the GPU (requires at least one compatible OptiX device)", 1), -) -enum_denoising_optix_input_passes = ( +def enum_openimagedenoise_denoiser(self, context): + if _cycles.with_openimagedenoise: + return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)] + return [] + +def enum_optix_denoiser(self, context): + if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')): + return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs", 2)] + return [] + +def enum_preview_denoiser(self, context): + optix_items = enum_optix_denoiser(self, context) + oidn_items = enum_openimagedenoise_denoiser(self, context) + + if len(optix_items) or len(oidn_items): + items = [('AUTO', "Automatic", "Use the fastest available denoiser for viewport rendering (OptiX if available, OpenImageDenoise otherwise)", 0)] + else: + items = [('AUTO', "None", "Blender was compiled without a viewport denoiser", 0)] + + items += optix_items + items += oidn_items + return items + +def enum_denoiser(self, context): + items = [('NLM', "NLM", "Cycles native non-local means denoiser, running on any compute device", 1)] + items += enum_optix_denoiser(self, context) + items += enum_openimagedenoise_denoiser(self, context) + return items + +enum_denoising_input_passes = ( ('RGB', "Color", "Use only color as input", 1), ('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data as input", 2), ('RGB_ALBEDO_NORMAL', "Color + Albedo + Normal", "Use color, albedo and normal data as input", 3), ) + +def update_render_passes(self, context): + scene = context.scene + view_layer = context.view_layer + view_layer.update_render_passes() + engine.detect_conflicting_passes(scene, view_layer) + + class CyclesRenderSettings(bpy.types.PropertyGroup): device: EnumProperty( @@ -236,11 +257,32 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): description="Pause all viewport preview renders", default=False, ) - preview_denoising: EnumProperty( - name="Viewport Denoising", - description="Denoise the image after each preview update with the selected denoiser engine", - items=enum_viewport_denoising, - default='NONE', + + use_denoising: BoolProperty( + name="Use Denoising", + description="Denoise the rendered image", + default=False, + ) + use_preview_denoising: BoolProperty( + name="Use Viewport Denoising", + description="Denoise the image in the 3D viewport", + default=False, + ) + + denoiser: EnumProperty( + name="Denoiser", + description="Denoise the image with the selected denoiser. " + "For denoising the image after rendering, denoising data render passes " + "also adapt to the selected denoiser", + items=enum_denoiser, + default=1, + update=update_render_passes, + ) + preview_denoiser: EnumProperty( + name="Viewport Denoiser", + description="Denoise the image after each preview update with the selected denoiser", + items=enum_preview_denoiser, + default=0, ) use_square_samples: BoolProperty( @@ -256,7 +298,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default=128, ) preview_samples: IntProperty( - name="Preview Samples", + name="Viewport Samples", description="Number of samples to render in the viewport, unlimited if 0", min=0, max=(1 << 24), default=32, @@ -476,7 +518,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): subtype='PIXEL' ) preview_dicing_rate: FloatProperty( - name="Preview Dicing Rate", + name="Viewport Dicing Rate", description="Size of a micropolygon in pixels during preview render", min=0.1, max=1000.0, soft_min=0.5, default=8.0, @@ -629,11 +671,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): items=enum_bvh_types, default='DYNAMIC_BVH', ) - use_bvh_embree: BoolProperty( - name="Use Embree", - description="Use Embree as ray accelerator", - default=False, - ) debug_use_spatial_splits: BoolProperty( name="Use Spatial Splits", description="Use BVH spatial splits: longer builder time, faster render", @@ -786,7 +823,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): debug_bvh_layout: EnumProperty( name="BVH Layout", items=enum_bvh_layouts, - default='BVH8', + default='EMBREE', ) debug_use_cpu_split_kernel: BoolProperty(name="Split Kernel", default=False) @@ -794,6 +831,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): debug_use_cuda_split_kernel: BoolProperty(name="Split Kernel", default=False) debug_optix_cuda_streams: IntProperty(name="CUDA Streams", default=1, min=1) + debug_optix_curves_api: BoolProperty(name="Native OptiX Curve Primitive", default=False) debug_opencl_kernel_type: EnumProperty( name="OpenCL Kernel Type", @@ -1241,39 +1279,17 @@ class CyclesObjectSettings(bpy.types.PropertyGroup): class CyclesCurveRenderSettings(bpy.types.PropertyGroup): - primitive: EnumProperty( - name="Primitive", - description="Type of primitive used for hair rendering", - items=enum_curve_primitives, - default='LINE_SEGMENTS', - ) shape: EnumProperty( name="Shape", description="Form of hair", items=enum_curve_shape, - default='THICK', - ) - cull_backfacing: BoolProperty( - name="Cull Back-faces", - description="Do not test the back-face of each strand", - default=True, - ) - use_curves: BoolProperty( - name="Use Cycles Hair Rendering", - description="Activate Cycles hair rendering for particle system", - default=True, - ) - resolution: IntProperty( - name="Resolution", - description="Resolution of generated mesh", - min=3, max=64, - default=3, + default='RIBBONS', ) subdivisions: IntProperty( name="Subdivisions", description="Number of subdivisions used in Cardinal curve intersection (power of 2)", min=0, max=24, - default=4, + default=2, ) @classmethod @@ -1289,12 +1305,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): del bpy.types.Scene.cycles_curves -def update_render_passes(self, context): - view_layer = context.view_layer - view_layer.update_render_passes() - engine.detect_conflicting_passes(view_layer) - - class CyclesAOVPass(bpy.types.PropertyGroup): name: StringProperty( name="Name", @@ -1369,7 +1379,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): use_denoising: BoolProperty( name="Use Denoising", description="Denoise the rendered image", - default=False, + default=True, update=update_render_passes, ) denoising_diffuse_direct: BoolProperty( @@ -1428,7 +1438,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): ) denoising_store_passes: BoolProperty( name="Store Denoising Passes", - description="Store the denoising feature passes and the noisy image", + description="Store the denoising feature passes and the noisy image. The passes adapt to the denoiser selected for rendering", default=False, update=update_render_passes, ) @@ -1439,19 +1449,20 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): default=0, ) - use_optix_denoising: BoolProperty( - name="OptiX AI-Accelerated", - description="Use the OptiX denoiser to denoise the rendered image", - default=False, - update=update_render_passes, - ) denoising_optix_input_passes: EnumProperty( name="Input Passes", - description="Passes handed over to the OptiX denoiser (this can have different effects on the denoised image)", - items=enum_denoising_optix_input_passes, + description="Passes used by the denoiser to distinguish noise from shader and geometry detail", + items=enum_denoising_input_passes, default='RGB_ALBEDO', ) + denoising_openimagedenoise_input_passes: EnumProperty( + name="Input Passes", + description="Passes used by the denoiser to distinguish noise from shader and geometry detail", + items=enum_denoising_input_passes, + default='RGB_ALBEDO_NORMAL', + ) + use_pass_crypto_object: BoolProperty( name="Cryptomatte Object", description="Render cryptomatte object pass, for isolating objects in compositing", |