diff options
author | Alfredo de Greef <eeshlo@yahoo.com> | 2004-08-12 03:32:13 +0400 |
---|---|---|
committer | Alfredo de Greef <eeshlo@yahoo.com> | 2004-08-12 03:32:13 +0400 |
commit | 012854ae9323aadc4b0345c9ebd3260a636dd85b (patch) | |
tree | 8f16ad563f0427b9b4f23e9d7a249bccf90e031a /source/blender/yafray | |
parent | 9bbc1e9c0aa5107f9782ab9949ebf285fb1dbea8 (diff) |
Fixed bug discovered by dotblend, parented empty's were mistakenly
included in the duplicate objects list.
Added support for spherelight 'dummy' mode when used with global photonmap.
It now behaves the same as arealight when used with gpm.
Diffstat (limited to 'source/blender/yafray')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 23 | ||||
-rw-r--r-- | source/blender/yafray/intern/export_Plugin.cpp | 25 |
2 files changed, 31 insertions, 17 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 61d15bff0c9..22f8f1f042a 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -1052,11 +1052,10 @@ void yafrayFileRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][4] // if no GI used, the GIphotons flag can still be set, so only use when 'full' selected if ((R.r.GImethod==2) && (R.r.GIphotons)) { md="on"; power*=R.r.GIpower; } ostr << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\""<< md << "\" power=\"" << power << "\" "; - if (!R.r.GIphotons) { - int psm=0, sm = lamp->ray_totsamp; - if (sm>=25) psm = sm/5; - ostr << "samples=\"" << sm << "\" psamples=\"" << psm << "\" "; - } + // samples not used for GI with photons, can still be exported, is ignored + int psm=0, sm = lamp->ray_totsamp; + if (sm>=25) psm = sm/5; + ostr << "samples=\"" << sm << "\" psamples=\"" << psm << "\" "; ostr << ">\n"; // transform area lamp coords back to world @@ -1138,7 +1137,15 @@ void yafrayFileRender_t::writeLamps() //decay = 1; } } - ostr << "\" power=\"" << pwr << "\""; + + if (is_sphereL) { + // 'dummy' mode for spherelight when used with gpm + string md = "off"; + // if no GI used, the GIphotons flag can still be set, so only use when 'full' selected + if ((R.r.GImethod==2) && (R.r.GIphotons)) { md="on"; pwr*=R.r.GIpower; } + ostr << "\" power=\"" << pwr << "\" dummy=\"" << md << "\""; + } + else ostr << "\" power=\"" << pwr << "\""; // cast_shadows flag not used with softlight, spherelight or photonlight if ((!is_softL) && (!is_sphereL) && (lamp->type!=LA_YF_PHOTON)) { @@ -1297,7 +1304,7 @@ void yafrayFileRender_t::writeHemilight() void yafrayFileRender_t::writePathlight() { ostr.str(""); - if(R.r.GIphotons) + if (R.r.GIphotons) { ostr << "<light type=\"globalphotonlight\" name=\"gpm\" photons=\""<<R.r.GIphotoncount<<"\""<<endl; ostr << "\tradius=\"" <<R.r.GIphotonradius << "\" depth=\""<< ((R.r.GIdepth>2) ? (R.r.GIdepth-1) : 1) @@ -1305,7 +1312,7 @@ void yafrayFileRender_t::writePathlight() ostr << "</light>"<<endl; } ostr << "<light type=\"pathlight\" name=\"path_LT\" power=\"1.0\" "; - ostr << " depth=\"" <<((R.r.GIphotons) ? 1 : R.r.GIdepth)<< "\" caus_depth=\"" << R.r.GIcausdepth <<"\"\n"; + ostr << " depth=\"" << ((R.r.GIphotons) ? 1 : R.r.GIdepth) << "\" caus_depth=\"" << R.r.GIcausdepth <<"\"\n"; if(R.r.GIdirect && R.r.GIphotons) ostr << "direct=\"on\"" << endl; if (R.r.GIcache && ! (R.r.GIdirect && R.r.GIphotons)) { diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index 63f447c3768..a3d1624820b 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -1058,13 +1058,11 @@ void yafrayPluginRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][ params["name"]=yafray::parameter_t(temp); params["dummy"]=yafray::parameter_t(md); params["power"]=yafray::parameter_t(power); - if (!R.r.GIphotons) - { - int psm=0, sm = lamp->ray_totsamp; - if (sm>=25) psm = sm/5; - params["samples"]=yafray::parameter_t(sm); - params["psamples"]=yafray::parameter_t(psm); - } + // samples not used for GI with photons, can still be exported, is ignored + int psm=0, sm = lamp->ray_totsamp; + if (sm>=25) psm = sm/5; + params["samples"]=yafray::parameter_t(sm); + params["psamples"]=yafray::parameter_t(psm); // transform area lamp coords back to world float lpco[4][3]; @@ -1147,7 +1145,16 @@ void yafrayPluginRender_t::writeLamps() //decay = 1; } } - params["power"] = yafray::parameter_t(pwr); + + if (is_sphereL) { + // 'dummy' mode for spherelight when used with gpm + string md = "off"; + // if no GI used, the GIphotons flag can still be set, so only use when 'full' selected + if ((R.r.GImethod==2) && (R.r.GIphotons)) { md="on"; pwr*=R.r.GIpower; } + params["power"] = yafray::parameter_t(pwr); + params["dummy"] = yafray::parameter_t(md); + } + else params["power"] = yafray::parameter_t(pwr); // cast_shadows flag not used with softlight, spherelight or photonlight if ((!is_softL) && (!is_sphereL) && (lamp->type!=LA_YF_PHOTON)) { @@ -1299,7 +1306,7 @@ void yafrayPluginRender_t::writeHemilight() void yafrayPluginRender_t::writePathlight() { - if(R.r.GIphotons) + if (R.r.GIphotons) { yafray::paramMap_t params; params["type"]=yafray::parameter_t("globalphotonlight"); |