Permalink
Browse files

Add use AO in DirectLight. New color selector.

  • Loading branch information...
1 parent 8a673de commit fad39e135794ad3fa1f68cf6b63d82eef9b766bd @exvion committed Aug 25, 2010
View
@@ -331,6 +331,14 @@ def SU2YAFARAY.export_volumeintegrator(yi)
yi.createIntegrator("volintegr")
end
+def SU2YAFARAY.paramsSetColorHex(yi,option_name,value)
+ rgb=value
+ r = rgb[0..1].to_i(16)
+ g = rgb[2..3].to_i(16)
+ b = rgb[4..5].to_i(16)
+ yi.paramsSetColor(option_name,r/255.0, g/255.0, b/255.0)
+end
+
def SU2YAFARAY.export_integrator(yi)
#integrators
yi.paramsClearAll()
@@ -350,12 +358,11 @@ def SU2YAFARAY.export_integrator(yi)
yi.paramsSetInt("caustic_depth", 10)
yi.paramsSetFloat("caustic_radius", 0.1)
end
+ yi.paramsSetBool("do_AO", @ys.do_AO)
if @ys.do_AO
- p "use AO"
- yi.paramsSetBool("do_AO", @ys.do_AO)
- yi.paramsSetInt("AO_samples", 32)
- yi.paramsSetFloat("AO_distance", 1)
- yi.paramsSetColor("AO_color", 1, 1, 1)
+ yi.paramsSetInt("AO_samples",Integer(@ys.AO_samples))
+ yi.paramsSetFloat("AO_distance", Float(@ys.AO_distance))
+ SU2YAFARAY.paramsSetColorHex(yi,"AO_color",@ys.AO_color)
end
elsif (@ys.light_type=="photonmapping")
yi.paramsSetString("type", "photonmapping")
@@ -392,19 +399,7 @@ def SU2YAFARAY.export_integrator(yi)
end
yi.createIntegrator("default")
-
- #yi.paramsSetString("type", "photonmapping")
- # yi.paramsSetColor("AO_color",0.332555,0.414614,0.447731,1)
- # yi.paramsSetFloat("AO_distance",1)
- # yi.paramsSetInt("AO_samples",32)
- # yi.paramsSetBool("do_AO",true)
- # yi.paramsSetBool("caustics",false)
- # yi.paramsSetInt("raydepth",Integer(@ys.raydepth))
- # yi.paramsSetInt("shadowDepth",Integer(@ys.shadowDepth))
- # yi.paramsSetBool("transpShad",@ys.transpShad)
- # yi.paramsSetString("type", "directlighting")
- # yi.createIntegrator("default")
end
def SU2YAFARAY.export_lights(yi)
@@ -73,6 +73,9 @@ class YafaraySettings
#direct light
'caustics'=>false,
'do_AO'=>false,
+ 'AO_samples'=>'32',
+ 'AO_distance'=>'1.0',
+ 'AO_color'=>'FFFFFF',
#camera
'camera_type'=>'perspective',
@@ -144,7 +144,13 @@ def initialize
@ys.caustics=false if value=="false"
when "do_AO"
@ys.do_AO=true if value=="true"
- @ys.do_AO=false if value="false"
+ @ys.do_AO=false if value=="false"
+ when "AO_samples"
+ @ys.AO_samples=value
+ when "AO_distance"
+ @ys.AO_distance=value
+ when "AO_color"
+ @ys.AO_color=value
#camera
when "camera_type"
@ys.camera_type=value
@@ -316,6 +322,9 @@ def SendDataFromSketchup()
setValue("pm_caustic_mix",@ys.pm_caustic_mix)
#direct_lighting
setCheckbox("do_AO",@ys.do_AO)
+ setValue("AO_color",@ys.AO_color)
+ setValue("AO_samples",@ys.AO_samples)
+ setValue("AO_distance",@ys.AO_distance)
setCheckbox("caustics",@ys.caustics)
#camera
setValue("camera_type",@ys.camera_type)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit fad39e1

Please sign in to comment.