Global POV Properties added and GUI updated (photons; radiosity; encoding...)

This commit is contained in:
Maurice Raybaud 2017-01-31 22:30:40 +01:00
parent 7faf5784ea
commit 45532d6b7d
3 changed files with 182 additions and 34 deletions

View File

@ -220,6 +220,80 @@ class RenderPovSettingsScene(PropertyGroup):
description="Number of reflections/refractions allowed on ray "
"path",
min=1, max=256, default=5)
#######NEW from Lanuhum
adc_bailout_enable = BoolProperty(
name="Enable",
description="",
default=False)
adc_bailout = FloatProperty(
name="ADC Bailout",
description="",
min=0.0, max=1000.0,default=0.00392156862745, precision=3)
ambient_light_enable = BoolProperty(
name="Enable",
description="",
default=False)
ambient_light = FloatVectorProperty(
name="Ambient Light", description="Ambient light is used to simulate the effect of inter-diffuse reflection",
precision=4, step=0.01, min=0, soft_max=1,
default=(1, 1, 1), options={'ANIMATABLE'}, subtype='COLOR')
global_settings_advanced = BoolProperty(
name="Advanced",
description="",
default=False)
irid_wavelength_enable = BoolProperty(
name="Enable",
description="",
default=False)
irid_wavelength = FloatVectorProperty(
name="Irid Wavelength", description="Iridescence calculations depend upon the dominant wavelengths of the primary colors of red, green and blue light.",
precision=4, step=0.01, min=0, soft_max=1,
default=(0.25,0.18,0.14), options={'ANIMATABLE'}, subtype='COLOR')
charset = EnumProperty(
name="Charset",
description="This allows you to specify the assumed character set of all text strings.",
items=(("ascii", "ASCII", ""),
("utf8", "UTF-8", ""),
("sys", "SYS", "")),
default="utf8")
max_intersections_enable = BoolProperty(
name="Enable",
description="",
default=False)
max_intersections = IntProperty(
name="Max Intersections",
description="POV-Ray uses a set of internal stacks to collect ray/object intersection points.",
min=2, max=1024, default=64)
number_of_waves_enable = BoolProperty(
name="Enable",
description="",
default=False)
number_of_waves = IntProperty(
name="Number Waves",
description="The waves and ripples patterns are generated by summing a series of waves, each with a slightly different center and size.",
min=1, max=10, default=1000)
noise_generator_enable = BoolProperty(
name="Enable",
description="",
default=False)
noise_generator = IntProperty(
name="Noise Generator",
description="There are three noise generators implemented.",
min=1, max=3, default=2)
########################### PHOTONS #######################################
photon_enable = BoolProperty(
@ -276,7 +350,7 @@ class RenderPovSettingsScene(PropertyGroup):
name="Always Sample",
description="Only use the data from the pretrace step and not gather "
"any new samples during the final radiosity pass",
default=True)
default=False)
radio_brightness = FloatProperty(
name="Brightness",
@ -308,17 +382,26 @@ class RenderPovSettingsScene(PropertyGroup):
"tolerance for less critical last refining pass",
min=0.000001, max=1.0, soft_min=0.000001, soft_max=1.0, default=0.5)
# max_sample - not available yet
radio_media = BoolProperty(
name="Media", description="Radiosity estimation can be affected by media",
default=False)
radio_subsurface = BoolProperty(
name="Subsurface", description="Radiosity estimation can be affected by Subsurface Light Transport",
default=False)
radio_minimum_reuse = FloatProperty(
name="Minimum Reuse",
description="Fraction of the screen width which sets the minimum radius of reuse "
"for each sample point (At values higher than 2% expect errors)",
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
radio_maximum_reuse = FloatProperty(
name="Maximum Reuse",
description="The maximum reuse parameter works in conjunction with, and is similar to that of minimum reuse, "
"the only difference being that it is an upper bound rather than a lower one.",
min=0.0, max=1.0,default=0.2, precision=3)
radio_nearest_count = IntProperty(
name="Nearest Count",
description="Number of old ambient values blended together to "

View File

@ -3288,22 +3288,39 @@ def write_pov(filename, scene=None, info_callback=None):
tabWrite("assumed_gamma 1.0\n")
tabWrite("max_trace_level %d\n" % scene.pov.max_trace_level)
if scene.pov.charset != 'ascii':
file.write(" charset %s\n"%scene.pov.charset)
if scene.pov.global_settings_advanced:
if scene.pov.adc_bailout_enable and scene.pov.radio_enable == False:
file.write(" adc_bailout %.6f\n"%scene.pov.adc_bailout)
if scene.pov.ambient_light_enable:
file.write(" ambient_light <%.6f,%.6f,%.6f>\n"%scene.pov.ambient_light[:])
if scene.pov.irid_wavelength_enable:
file.write(" irid_wavelength <%.6f,%.6f,%.6f>\n"%scene.pov.irid_wavelength[:])
if scene.pov.max_intersections_enable:
file.write(" max_intersections %s\n"%scene.pov.max_intersections)
if scene.pov.number_of_waves_enable:
file.write(" number_of_waves %s\n"%scene.pov.number_of_waves)
if scene.pov.noise_generator_enable:
file.write(" noise_generator %s\n"%scene.pov.noise_generator)
if scene.pov.radio_enable:
tabWrite("radiosity {\n")
tabWrite("adc_bailout %.4g\n" % scene.pov.radio_adc_bailout)
tabWrite("always_sample %d\n" % scene.pov.radio_always_sample)
tabWrite("brightness %.4g\n" % scene.pov.radio_brightness)
tabWrite("count %d\n" % scene.pov.radio_count)
tabWrite("error_bound %.4g\n" % scene.pov.radio_error_bound)
tabWrite("gray_threshold %.4g\n" % scene.pov.radio_gray_threshold)
tabWrite("low_error_factor %.4g\n" % scene.pov.radio_low_error_factor)
tabWrite("media %d\n" % scene.pov.radio_media)
tabWrite("maximum_reuse %.4g\n" % scene.pov.radio_maximum_reuse)
tabWrite("minimum_reuse %.4g\n" % scene.pov.radio_minimum_reuse)
tabWrite("nearest_count %d\n" % scene.pov.radio_nearest_count)
tabWrite("normal %d\n" % scene.pov.radio_normal)
tabWrite("pretrace_start %.3g\n" % scene.pov.radio_pretrace_start)
tabWrite("pretrace_end %.3g\n" % scene.pov.radio_pretrace_end)
tabWrite("recursion_limit %d\n" % scene.pov.radio_recursion_limit)
tabWrite("always_sample %d\n" % scene.pov.radio_always_sample)
tabWrite("normal %d\n" % scene.pov.radio_normal)
tabWrite("media %d\n" % scene.pov.radio_media)
tabWrite("subsurface %d\n" % scene.pov.radio_subsurface)
tabWrite("}\n")
onceSss = 1
onceAmbient = 1
@ -3328,17 +3345,18 @@ def write_pov(filename, scene=None, info_callback=None):
tabWrite("ambient_light rgb<%.3g, %.3g, %.3g>\n" % world.ambient_color[:])
onceAmbient = 0
if (oncePhotons and
(material.pov.refraction_type == "2" or
material.pov.photons_reflection == True)):
tabWrite("photons {\n")
tabWrite("spacing %.6f\n" % scene.pov.photon_spacing)
tabWrite("max_trace_level %d\n" % scene.pov.photon_max_trace_level)
tabWrite("adc_bailout %.3g\n" % scene.pov.photon_adc_bailout)
tabWrite("gather %d, %d\n" % (scene.pov.photon_gather_min,
scene.pov.photon_gather_max))
tabWrite("}\n")
oncePhotons = 0
if scene.pov.photon_enable:
if (oncePhotons and
(material.pov.refraction_type == "2" or
material.pov.photons_reflection == True)):
tabWrite("photons {\n")
tabWrite("spacing %.6f\n" % scene.pov.photon_spacing)
tabWrite("max_trace_level %d\n" % scene.pov.photon_max_trace_level)
tabWrite("adc_bailout %.3g\n" % scene.pov.photon_adc_bailout)
tabWrite("gather %d, %d\n" % (scene.pov.photon_gather_min,
scene.pov.photon_gather_max))
tabWrite("}\n")
oncePhotons = 0
tabWrite("}\n")

View File

@ -439,8 +439,15 @@ class RENDER_PT_povray_render_settings(RenderButtonsPanel, bpy.types.Panel):
bl_icon = 'SETTINGS'
COMPAT_ENGINES = {'POVRAY_RENDER'}
# def draw_header(self, context):
# self.layout.label(icon='SETTINGS')
def draw_header(self, context):
self.layout.label(icon='SETTINGS')
scene = context.scene
if scene.pov.global_settings_advanced:
self.layout.prop(scene.pov, "global_settings_advanced", text="", icon='PREFERENCES')
else:
self.layout.prop(scene.pov, "global_settings_advanced", text="", icon='SETTINGS')
def draw(self, context):
layout = self.layout
@ -451,19 +458,59 @@ class RENDER_PT_povray_render_settings(RenderButtonsPanel, bpy.types.Panel):
col.label(text="Global Settings:")
col.prop(scene.pov, "max_trace_level", text="Ray Depth")
if scene.pov.global_settings_advanced:
layout.prop(scene.pov,"charset")
align = True
row = layout.row(align = align)
row.prop(scene.pov,"adc_bailout_enable",text = "")
row.prop(scene.pov,"adc_bailout")
row = layout.row(align = align)
row.prop(scene.pov,"ambient_light_enable",text = "")
row.prop(scene.pov,"ambient_light")
row = layout.row(align = align)
row.prop(scene.pov,"irid_wavelength_enable",text = "")
row.prop(scene.pov,"irid_wavelength")
row = layout.row(align = align)
row.prop(scene.pov,"max_intersections_enable",text = "")
row.prop(scene.pov,"max_intersections")
row = layout.row(align = align)
row.prop(scene.pov,"number_of_waves_enable",text = "")
row.prop(scene.pov,"number_of_waves")
row = layout.row(align = align)
row.prop(scene.pov,"noise_generator_enable",text = "")
row.prop(scene.pov,"noise_generator")
col.label(text="Global Photons:")
col.prop(scene.pov, "photon_max_trace_level", text="Photon Depth")
class RENDER_PT_povray_photons(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Photons"
COMPAT_ENGINES = {'POVRAY_RENDER'}
split = layout.split()
# def draw_header(self, context):
# self.layout.label(icon='SETTINGS')
col = split.column()
col.prop(scene.pov, "photon_spacing", text="Spacing")
col.prop(scene.pov, "photon_gather_min")
def draw_header(self, context):
scene = context.scene
if scene.pov.photon_enable:
self.layout.prop(scene.pov, "photon_enable", text="", icon='PMARKER_ACT')
else:
self.layout.prop(scene.pov, "photon_enable", text="", icon='PMARKER')
def draw(self, context):
scene = context.scene
layout = self.layout
if scene.pov.photon_enable:
col = layout.column()
#col.label(text="Global Photons:")
col.prop(scene.pov, "photon_max_trace_level", text="Photon Depth")
col = split.column()
col.prop(scene.pov, "photon_adc_bailout", text="Photon ADC")
col.prop(scene.pov, "photon_gather_max")
split = layout.split()
col = split.column()
col.prop(scene.pov, "photon_spacing", text="Spacing")
col.prop(scene.pov, "photon_gather_min")
col = split.column()
col.prop(scene.pov, "photon_adc_bailout", text="Photon ADC")
col.prop(scene.pov, "photon_gather_max")
class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel):
@ -557,24 +604,24 @@ class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(scene.pov, "radio_adc_bailout", slider=True)
col.prop(scene.pov, "radio_minimum_reuse", text="Min Reuse")
col.prop(scene.pov, "radio_gray_threshold", slider=True)
col.prop(scene.pov, "radio_low_error_factor", slider=True)
col.prop(scene.pov, "radio_pretrace_start", slider=True)
col.prop(scene.pov, "radio_low_error_factor", slider=True)
col = split.column()
col.prop(scene.pov, "radio_brightness")
col.prop(scene.pov, "radio_minimum_reuse", text="Min Reuse")
col.prop(scene.pov, "radio_maximum_reuse", text="Max Reuse")
col.prop(scene.pov, "radio_nearest_count")
col.prop(scene.pov, "radio_pretrace_end", slider=True)
split = layout.split()
col = split.column()
col = layout.column()
col.label(text="Estimation Influence:")
col.prop(scene.pov, "radio_media")
col.prop(scene.pov, "radio_always_sample")
col.prop(scene.pov, "radio_normal")
col.prop(scene.pov, "radio_media")
col.prop(scene.pov, "radio_subsurface")
split.prop(scene.pov, "radio_always_sample")
class RENDER_PT_povray_media(WorldButtonsPanel, bpy.types.Panel):