From 8b53b3056314f5304a3d0cac9a27b878136264de Mon Sep 17 00:00:00 2001 From: Alfredo de Greef Date: Sun, 25 Jan 2004 20:28:46 +0000 Subject: [PATCH] arealight now can be used without global photonmap fixed problem with spotlights not rendering --- source/blender/yafray/intern/export_File.cpp | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 4e85260756c..d9acf9e344d 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -368,7 +368,8 @@ void yafrayFileRender_t::writeTextures() ostr << "\tdata[i].pos << "\" >\n"; ostr << "\t\tdata[i].r << "\"" << " g=\"" << cb->data[i].g << "\"" << - " b=\"" << cb->data[i].b << "\" />\n"; + " b=\"" << cb->data[i].b << "\"" << + " a=\"" << cb->data[i].a << "\" />\n"; ostr << "\t\n"; } ostr << "\n\n"; @@ -1000,7 +1001,15 @@ void yafrayFileRender_t::writeAreaLamp(LampRen* lamp, int num) if (lamp->area_shape!=LA_AREA_SQUARE) return; float *a=lamp->area[0], *b=lamp->area[1], *c=lamp->area[2], *d=lamp->area[3]; ostr.str(""); - ostr << "dist <<"\">\n"; + string md = "off"; + if (R.r.GIphotons) md = "on"; + ostr << "dist << "\" "; + if (!R.r.GIphotons) { + int psm=0, sm = lamp->ray_totsamp; + if (sm>=16) psm = sm/4; + ostr << "samples=\"" << sm << "\" psamples=\"" << psm << "\" "; + } + ostr << ">\n"; ostr << "\t\n"; ostr << "\t\n"; ostr << "\t\n"; @@ -1017,7 +1026,7 @@ void yafrayFileRender_t::writeLamps() { ostr.str(""); LampRen* lamp = R.la[i]; - if (lamp->type==LA_AREA) { writeAreaLamp(lamp,i); continue; } + if (lamp->type==LA_AREA) { writeAreaLamp(lamp, i); continue; } // TODO: add decay setting in yafray ostr << "type==LA_LOCAL) @@ -1064,9 +1073,9 @@ void yafrayFileRender_t::writeLamps() ostr << "\tco[0] << "\" y=\"" << lamp->co[1] << "\" z=\"" << lamp->co[2] << "\" />\n"; // 'to' for spot, already calculated by Blender if (lamp->type==LA_SPOT) - ostr << "\tco[0] //+1e6*lamp->vec[0] - << "\" y=\"" << lamp->co[1] //+1e6*lamp->vec[1] - << "\" z=\"" << lamp->co[2] //+1e6*lamp->vec[2] + ostr << "\tco[0]+lamp->vec[0] + << "\" y=\"" << lamp->co[1]+lamp->vec[1] + << "\" z=\"" << lamp->co[2]+lamp->vec[2] << "\" />\n"; // color // rgb in LampRen is premultiplied by energy, power is compensated for that above