[Bf-extensions-cvs] [017c9f1] master: Added: UberPOV / POV Feature Set choice in user preferences Added: Stochastic antialiasing for UberPOV Added: Blurry Reflection for UberPOV Improved: Defaults for AA and Depth of Field to a better quality/time Improved: UV texture transforms more closely match BI and more functionalised

Maurice Raybaud noreply at git.blender.org
Wed Feb 18 19:01:19 CET 2015


Commit: 017c9f143d13294bbace5ef2e8159e9d96325dad
Author: Maurice Raybaud
Date:   Thu Feb 5 20:32:15 2015 +0100
Branches: master
https://developer.blender.org/rBA017c9f143d13294bbace5ef2e8159e9d96325dad

Added: UberPOV / POV Feature Set choice in user preferences
Added: Stochastic antialiasing for UberPOV
Added: Blurry Reflection for UberPOV
Improved: Defaults for AA and Depth of Field to a better quality/time
Improved: UV texture transforms more closely match BI and more functionalised

===================================================================

M	render_povray/__init__.py
M	render_povray/render.py
M	render_povray/ui.py

===================================================================

diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index d0e6d85..716ce0c 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -154,24 +154,30 @@ class RenderPovSettingsScene(PropertyGroup):
     antialias_method = EnumProperty(
             name="Method",
             description="AA-sampling method. Type 1 is an adaptive, non-recursive, super-sampling "
-                        "method. Type 2 is an adaptive and recursive super-sampling method",
+                        "method. Type 2 is an adaptive and recursive super-sampling method. "
+                        "Type 3 is a stochastic halton based super-sampling method",
             items=(("0", "non-recursive AA", "Type 1 Sampling in POV-Ray"),
-                   ("1", "recursive AA", "Type 2 Sampling in POV-Ray")),
+                   ("1", "recursive AA", "Type 2 Sampling in POV-Ray"),
+                   ("2", "stochastic AA", "Type 3 Sampling in UberPOV")),
             default="1")
-
+    antialias_confidence = FloatProperty(
+            name="Antialias Confidence", description="how surely the computed color "
+                                                     "of a given pixel is indeed"
+                                                     "within the threshold error margin.",
+            min=0.0001, max=1.0000, default=0.9900, precision=4)
     antialias_depth = IntProperty(
             name="Antialias Depth", description="Depth of pixel for sampling",
             min=1, max=9, default=3)
 
     antialias_threshold = FloatProperty(
             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)
+            min=0.0, max=1.0, soft_min=0.05, soft_max=0.5, default=0.03)
 
     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)
+            default=False)
 
     jitter_amount = FloatProperty(
             name="Jitter Amount", description="Amount of jittering",
@@ -921,29 +927,29 @@ class RenderPovSettingsCamera(PropertyGroup):
             description="Similar to a real camera's aperture effect over focal blur (though not "
                         "in physical units and independant of focal length). "
                         "Increase to get more blur",
-            min=0.01, max=1.00, default=0.25)
+            min=0.01, max=1.00, default=0.50)
 
     # Aperture adaptive sampling
     dof_samples_min = IntProperty(
             name="Samples Min", description="Minimum number of rays to use for each pixel",
-            min=1, max=128, default=96)
+            min=1, max=128, default=3)
 
     dof_samples_max = IntProperty(
             name="Samples Max", description="Maximum number of rays to use for each pixel",
-            min=1, max=128, default=128)
+            min=1, max=128, default=9)
 
     dof_variance = IntProperty(
             name="Variance",
             description="Minimum threshold (fractional value) for adaptive DOF sampling (up "
                         "increases quality and render time). The value for the variance should "
                         "be in the range of the smallest displayable color difference",
-            min=1, max=100000, soft_max=10000, default=256)
+            min=1, max=100000, soft_max=10000, default=8192)
 
     dof_confidence = FloatProperty(
             name="Confidence",
             description="Probability to reach the real color value. Larger confidence values "
                         "will lead to more samples, slower traces and better images",
-            min=0.01, max=0.99, default=0.90)
+            min=0.01, max=0.99, default=0.20)
 
     ##################################CustomPOV Code############################
     # Only DUMMIES below for now:
@@ -970,13 +976,21 @@ class RenderPovSettingsText(PropertyGroup):
 class PovrayPreferences(AddonPreferences):
     bl_idname = __name__
 
+    branch_feature_set_povray = EnumProperty(
+                name="Feature Set",
+                description="Choose between official (POV-Ray) or (UberPOV) development branch features to write in the pov file",
+                items= (('povray', 'Official POV-Ray', '','PLUGIN', 0), ('uberpov', 'Unofficial UberPOV', '', 'PLUGIN', 1)),
+                default='povray'
+                )
+    
     filepath_povray = StringProperty(
-                name="Povray Location",
+                name="Binary Location",
                 description="Path to renderer executable",
                 subtype='FILE_PATH',
                 )
     def draw(self, context):
         layout = self.layout
+        layout.prop(self, "branch_feature_set_povray")
         layout.prop(self, "filepath_povray")
 
     
diff --git a/render_povray/render.py b/render_povray/render.py
index 71ce789..9ffa4c8 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -82,10 +82,40 @@ def imgMap(ts):
     return image_map
 
 
+def imgMapTransforms(ts):
+    # XXX TODO: unchecked textures give error of variable referenced before assignment XXX
+    # POV-Ray "scale" is not a number of repetitions factor, but ,its
+    # inverse, a standard scale factor.
+    # 0.5 Offset is needed relatively to scale because center of the
+    # scale is 0.5,0.5 in blender and 0,0 in POV
+    image_map_transforms = ""
+    image_map_transforms = ("scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \
+                  ( 1.0 / ts.scale.x,
+                  1.0 / ts.scale.y,
+                  1.0 / ts.scale.z,
+                  0.5-(0.5/ts.scale.x) - (ts.offset.x),
+                  0.5-(0.5/ts.scale.y) - (ts.offset.y),
+                  ts.offset.z))    
+    # image_map_transforms = (" translate <-0.5,-0.5,0.0> scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \
+                  # ( 1.0 / ts.scale.x,
+                  # 1.0 / ts.scale.y,
+                  # 1.0 / ts.scale.z,
+                  # (0.5 / ts.scale.x) + ts.offset.x,
+                  # (0.5 / ts.scale.y) + ts.offset.y,
+                  # ts.offset.z))
+    # image_map_transforms = ("translate <-0.5,-0.5,0> scale <-1,-1,1> * <%.4g,%.4g,%.4g> translate <0.5,0.5,0> + <%.4g,%.4g,%.4g>" % \
+                  # (1.0 / ts.scale.x, 
+                  # 1.0 / ts.scale.y,
+                  # 1.0 / ts.scale.z,
+                  # ts.offset.x,
+                  # ts.offset.y,
+                  # ts.offset.z))
+    return image_map_transforms
+
 def imgMapBG(wts):
     image_mapBG = ""
     # texture_coords refers to the mapping of world textures:
-    if wts.texture_coords == 'VIEW':
+    if wts.texture_coords == 'VIEW' or wts.texture_coords == 'GLOBAL':
         image_mapBG = " map_type 0 "
     elif wts.texture_coords == 'ANGMAP':
         image_mapBG = " map_type 1 "
@@ -104,8 +134,8 @@ def imgMapBG(wts):
     #if image_mapBG == "":
     #    print(" No background texture image  found ")
     return image_mapBG
-
-
+    
+    
 def path_image(image):
     return bpy.path.abspath(image.filepath, library=image.library)
 
@@ -153,7 +183,7 @@ def renderable_objects():
 
 tabLevel = 0
 unpacked_images=[]
- 
+
 def exportPattern(texture):
     tex=texture
     pat = tex.pov
@@ -639,8 +669,19 @@ def write_pov(filename, scene=None, info_callback=None):
     world = scene.world
     global_matrix = mathutils.Matrix.Rotation(-pi / 2.0, 4, 'X')
     comments = scene.pov.comments_enable and not scene.pov.tempfiles_enable
-    linebreaksinlists= scene.pov.list_lf_enable and not scene.pov.tempfiles_enable
+    linebreaksinlists = scene.pov.list_lf_enable and not scene.pov.tempfiles_enable
+    feature_set = bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray
+    using_uberpov = (feature_set=='uberpov')
+    pov_binary = PovrayRender._locate_binary()
 
+    if using_uberpov:
+        print("Unofficial UberPOV feature set chosen in preferences")
+    else:
+        print("Official POV-Ray 3.7 feature set chosen in preferences")
+    if 'uber' in pov_binary: 
+        print("probably rendering with Uber POV binary")
+    else:
+        print("probably rendering with standard POV binary")
     def setTab(tabtype, spaces):
         TabStr = ""
         if tabtype == 'NONE':
@@ -933,16 +974,22 @@ def write_pov(filename, scene=None, info_callback=None):
                         raytrace_mirror = material.raytrace_mirror
                         if raytrace_mirror.reflect_factor:
                             tabWrite("reflection {\n")
-                            tabWrite("rgb <%.3g, %.3g, %.3g>" % material.mirror_color[:])
+                            tabWrite("rgb <%.3g, %.3g, %.3g>\n" % material.mirror_color[:])                          
                             if material.pov.mirror_metallic:
-                                tabWrite("metallic %.3g" % (raytrace_mirror.reflect_factor))
+                                tabWrite("metallic %.3g\n" % (raytrace_mirror.reflect_factor))
+                            # Blurry reflections for UberPOV
+                            if using_uberpov and raytrace_mirror.gloss_factor < 1.0:
+                                #tabWrite("#ifdef(unofficial) #if(unofficial = \"patch\") #if(patch(\"upov-reflection-roughness\") > 0)\n")
+                                tabWrite("roughness %.3g\n" % \
+                                         (1.0/raytrace_mirror.gloss_factor))
+                                #tabWrite("#end #end #end\n") # This and previous comment for backward compatibility, messier pov code
                             if material.pov.mirror_use_IOR:  # WORKING ?
                                 # Removed from the line below: gives a more physically correct
                                 # material but needs proper IOR. --Maurice
                                 tabWrite("fresnel 1 ")
                             tabWrite("falloff %.3g exponent %.3g} " % \
                                      (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor))
-
+                                
               

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list