diff options
Diffstat (limited to 'render_povray')
-rw-r--r-- | render_povray/__init__.py | 31 | ||||
-rw-r--r-- | render_povray/render.py | 14 | ||||
-rw-r--r-- | render_povray/ui.py | 17 |
3 files changed, 46 insertions, 16 deletions
diff --git a/render_povray/__init__.py b/render_povray/__init__.py index 863d0213..6a4a56d7 100644 --- a/render_povray/__init__.py +++ b/render_povray/__init__.py @@ -110,6 +110,18 @@ def register(): name="Antialias Threshold", description="Tolerance for sub-pixels", min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.1) + Scene.pov_jitter_enable = BoolProperty( + name="Jitter", description="Enable Jittering. Adds noise into the sampling process (it should be avoided to use jitter in animation).", + default=True) + + Scene.pov_jitter_amount = FloatProperty( + name="Jitter Amount", description="Amount of jittering.", + min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=1.0) + + Scene.pov_antialias_gamma = FloatProperty( + name="Antialias Gamma", description="POV-Ray compares gamma-adjusted values for super sampling. Antialias Gamma sets the Gamma before comparison.", + min=0.0, max=5.0, soft_min=0.01, soft_max=2.5, default=2.5) + Scene.pov_max_trace_level = IntProperty( name="Max Trace Level", description="Number of reflections/refractions allowed on ray path", min=1, max=256, default=5) @@ -296,14 +308,17 @@ def unregister(): del Scene.pov_media_color # MR del Scene.pov_baking_enable # MR del Scene.pov_max_trace_level # MR - del Scene.pov_antialias_enable # CR - del Scene.pov_antialias_method # CR - del Scene.pov_antialias_depth # CR - del Scene.pov_antialias_threshold # CR - del Scene.pov_command_line_switches # CR - del Scene.pov_indentation_character # CR - del Scene.pov_indentation_spaces # CR - del Scene.pov_comments_enable # CR + del Scene.pov_antialias_enable # CR + del Scene.pov_antialias_method # CR + del Scene.pov_antialias_depth # CR + del Scene.pov_antialias_threshold # CR + del Scene.pov_antialias_gamma # CR + del Scene.pov_jitter_enable # CR + del Scene.pov_jitter_amount # CR + del Scene.pov_command_line_switches # CR + del Scene.pov_indentation_character # CR + del Scene.pov_indentation_spaces # CR + del Scene.pov_comments_enable # CR del Mat.pov_irid_enable # MR del Mat.pov_mirror_use_IOR # MR del Mat.pov_mirror_metallic # MR diff --git a/render_povray/render.py b/render_povray/render.py index 31f90cd1..324bf3c1 100644 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -1410,8 +1410,9 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): y = int(render.resolution_y * render.resolution_percentage * 0.01) file = open(filename_ini.name, 'w') - file.write("Input_File_Name='%s'\n" % filename_pov.name) - file.write("Output_File_Name='%s'\n" % filename_image.name) + file.write('Version=3.7\n') + file.write('Input_File_Name=\'%s\'\n' % filename_pov.name) + file.write('Output_File_Name=\'%s\'\n' % filename_image.name) file.write('Width=%d\n' % x) file.write('Height=%d\n' % y) @@ -1437,15 +1438,18 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): # aa_mapping = {'5': 2, '8': 3, '11': 4, '16': 5} # method 2 (recursive) with higher max subdiv forced because no mipmapping in POV-Ray needs higher sampling. method = {'0':1, '1':2} file.write('Antialias=on\n') - print("Method: " + str(scene.pov_antialias_method)) file.write('Sampling_Method=%s\n' % method[scene.pov_antialias_method]) file.write('Antialias_Depth=%d\n' % scene.pov_antialias_depth) file.write('Antialias_Threshold=%.3g\n' % scene.pov_antialias_threshold) - file.write('Jitter=off\n')#prevent animation flicker + file.write('Antialias_Gamma=%.3g\n' % scene.pov_antialias_gamma) + if scene.pov_jitter_enable: + file.write('Jitter=on\n') + file.write('Jitter_Amount=%3g\n' % scene.pov_jitter_amount) + else: + file.write('Jitter=off\n')#prevent animation flicker else: file.write('Antialias=off\n') - file.write('Version=3.7') #print('ini file closed %s' % file.closed) file.close() #print('ini file closed %s' % file.closed) diff --git a/render_povray/ui.py b/render_povray/ui.py index 27444ab3..1e14519b 100644 --- a/render_povray/ui.py +++ b/render_povray/ui.py @@ -303,12 +303,23 @@ class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel): col = split.column() col.prop(scene, "pov_antialias_method", text="") col = split.column() - + col.prop(scene, "pov_jitter_enable", text="Jitter") + split = layout.split() col = split.column() - col.prop(scene, "pov_antialias_depth", text="Depth") + col.prop(scene, "pov_antialias_depth", text="AA Depth") + sub = split.column() + sub.prop(scene, "pov_jitter_amount", text="Jitter Amount") + if scene.pov_jitter_enable: + sub.enabled = True + else: + sub.enabled = False + + split = layout.split() + col = split.column() + col.prop(scene, "pov_antialias_threshold", text="AA Threshold") col = split.column() - col.prop(scene, "pov_antialias_threshold", text="Threshold") + col.prop(scene, "pov_antialias_gamma", text="AA Gamma") class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel): |