diff options
author | Alfredo de Greef <eeshlo@yahoo.com> | 2004-01-25 23:28:46 +0300 |
---|---|---|
committer | Alfredo de Greef <eeshlo@yahoo.com> | 2004-01-25 23:28:46 +0300 |
commit | 8b53b3056314f5304a3d0cac9a27b878136264de (patch) | |
tree | 8c5c57657cd8f66631fe41edd2a8dc337518a3a2 /source/blender/yafray | |
parent | 82f8155c3c073b0fd86ac79519723e8cccd5a0ed (diff) |
arealight now can be used without global photonmap
fixed problem with spotlights not rendering
Diffstat (limited to 'source/blender/yafray')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 21 |
1 files 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 << "\t<modulator value=\"" << cb->data[i].pos << "\" >\n"; ostr << "\t\t<color r=\"" << cb->data[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</modulator>\n"; } ostr << "</shader>\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 << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\"on\" power=\"" << lamp->dist <<"\">\n"; + string md = "off"; + if (R.r.GIphotons) md = "on"; + ostr << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\""<< md << "\" power=\"" << lamp->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<a x=\""<< a[0] <<"\" y=\""<< a[1] <<"\" z=\"" << a[2] <<"\" />\n"; ostr << "\t<b x=\""<< b[0] <<"\" y=\""<< b[1] <<"\" z=\"" << b[2] <<"\" />\n"; ostr << "\t<c x=\""<< c[0] <<"\" y=\""<< c[1] <<"\" z=\"" << c[2] <<"\" />\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 << "<light type=\""; if (lamp->type==LA_LOCAL) @@ -1064,9 +1073,9 @@ void yafrayFileRender_t::writeLamps() ostr << "\t<from x=\"" << lamp->co[0] << "\" y=\"" << lamp->co[1] << "\" z=\"" << lamp->co[2] << "\" />\n"; // 'to' for spot, already calculated by Blender if (lamp->type==LA_SPOT) - ostr << "\t<to x=\"" << lamp->co[0] //+1e6*lamp->vec[0] - << "\" y=\"" << lamp->co[1] //+1e6*lamp->vec[1] - << "\" z=\"" << lamp->co[2] //+1e6*lamp->vec[2] + ostr << "\t<to x=\"" << lamp->co[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 |