forked from bartvdbraak/blender
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.
This commit is contained in:
parent
9bbc1e9c0a
commit
012854ae93
@ -2966,14 +2966,14 @@ void RE_rotateBlenderScene(void)
|
||||
yafray only needs to know about one, the rest can be instanciated.
|
||||
The dupliMtx list is used for this purpose */
|
||||
if (R.r.renderer==R_YAFRAY) {
|
||||
/* Special case, parent object dupli's: ignore lattices */
|
||||
/* Special case, parent object dupli's: ignore lattices & empty's */
|
||||
if (ob->parent) {
|
||||
if ((ob->parent->type!=OB_LATTICE) && (YAF_objectKnownData(ob)))
|
||||
if ((ob->parent->type!=OB_EMPTY) && (ob->parent->type!=OB_LATTICE) && YAF_objectKnownData(ob))
|
||||
printf("From parent: Added dupli matrix for linked data object %s\n", ob->id.name);
|
||||
else
|
||||
init_render_object(ob);
|
||||
}
|
||||
else if ((ob->type!=OB_EMPTY) && (ob->type!=OB_LAMP) && (YAF_objectKnownData(ob)))
|
||||
else if ((ob->type!=OB_EMPTY) && (ob->type!=OB_LAMP) && YAF_objectKnownData(ob))
|
||||
printf("Added dupli matrix for linked data object %s\n", ob->id.name);
|
||||
else
|
||||
init_render_object(ob);
|
||||
|
@ -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) {
|
||||
// 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))
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user