Reflection caustics did not work, fixed.

Note to users: even when you only want reflection caustics (metals/mirrors)
you have to set a IOR value higher than 1, similar to glass materials.
The higher, the brighter the caustics.

That should be it...
This commit is contained in:
2004-07-29 18:51:17 +00:00
parent 6bcf9d5139
commit 425cfa10eb
2 changed files with 18 additions and 14 deletions

View File

@@ -751,17 +751,21 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
char* matname = VLR_list[0]->mat->id.name;
bool shadow=VLR_list[0]->mat->mode & MA_TRACEBLE;
ostr <<" shadow=\""<< (shadow ? "on" : "off" )<<"\" ";
if (VLR_list[0]->mat->mode & MA_RAYTRANSP)
ostr << "caus_IOR=\"" << VLR_list[0]->mat->ang << "\" ";
bool caus = (((VLR_list[0]->mat->mode & MA_RAYTRANSP) | (VLR_list[0]->mat->mode & MA_RAYMIRROR))!=0);
if (caus) ostr << "caus_IOR=\"" << VLR_list[0]->mat->ang << "\"";
if (strlen(matname)==0) matname = "blender_default";
ostr << " shader_name=\"" << matname << "\" >\n";
ostr << "\t<attributes>\n";
if (VLR_list[0]->mat->mode & MA_RAYTRANSP)
if (caus)
{
float tr=1.0-VLR_list[0]->mat->alpha;
ostr << "\t\t<caus_tcolor r=\"" << VLR_list[0]->mat->r * tr
<< "\" g=\"" << VLR_list[0]->mat->g * tr
<< "\" b=\"" << VLR_list[0]->mat->b * tr << "\" />\n";
float tr = 1.0-VLR_list[0]->mat->alpha;
ostr << "\t\t<caus_tcolor r=\"" << VLR_list[0]->mat->r*tr
<< "\" g=\"" << VLR_list[0]->mat->g*tr
<< "\" b=\"" << VLR_list[0]->mat->b*tr << "\" />\n";
tr = VLR_list[0]->mat->ray_mirror;
ostr << "\t\t<caus_rcolor r=\"" << VLR_list[0]->mat->mirr*tr
<< "\" g=\"" << VLR_list[0]->mat->mirg*tr
<< "\" b=\"" << VLR_list[0]->mat->mirb*tr << "\" />\n";
}
ostr << "\t</attributes>\n";
xmlfile << ostr.str();

View File

@@ -917,15 +917,15 @@ void yafrayPluginRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_
bool castShadows=VLR_list[0]->mat->mode & MA_TRACEBLE;
float caus_IOR=1.0;
yafray::color_t caus_tcolor(0.0,0.0,0.0),caus_rcolor(0.0,0.0,0.0);
bool caus=false;
if (VLR_list[0]->mat->mode & MA_RAYTRANSP)
{
caus_IOR=VLR_list[0]->mat->ang;
float tr=1.0-VLR_list[0]->mat->alpha;
bool caus = (((VLR_list[0]->mat->mode & MA_RAYTRANSP) | (VLR_list[0]->mat->mode & MA_RAYMIRROR))!=0);
if (caus) {
caus_IOR = VLR_list[0]->mat->ang;
float tr = 1.0-VLR_list[0]->mat->alpha;
caus_tcolor.set(VLR_list[0]->mat->r*tr, VLR_list[0]->mat->g*tr, VLR_list[0]->mat->b*tr);
caus=true;
tr = VLR_list[0]->mat->ray_mirror;
caus_rcolor.set(VLR_list[0]->mat->mirr*tr, VLR_list[0]->mat->mirg*tr, VLR_list[0]->mat->mirb*tr);
}
bool has_orco=(VLR_list[0]->v1->orco!=NULL);
bool has_orco = (VLR_list[0]->v1->orco!=NULL);
bool no_auto = true; //in case non-mesh, or mesh has no autosmooth
float sm_angle = 0.1f;
if (obj->type==OB_MESH)