From e4e096187e93f59c33e40cb1c8cbdf776a554b4d Mon Sep 17 00:00:00 2001 From: Alfredo de Greef Date: Mon, 30 May 2005 08:11:46 +0000 Subject: Since there still seem to be some commits being done, I thought I might sqeeze in a minor bugfix. I wouln't be surprised it is too late, but since it really is sort of minor, it doesn't matter really. I had mistakenly put the export of dispersion and absorption parameters in the ray_mirror block instead of ray_transp, which means that both dispersion and absorption can only be used if both ray mirror and ray transp are enabled. Anyway, I don't want to make everyone recompile release builds if already done, it is minor, but users should take this into account at least. --- source/blender/yafray/intern/export_File.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'source/blender/yafray/intern/export_File.cpp') diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index b0ac5bfa6a8..d35903ba91d 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -692,19 +692,6 @@ void yafrayFileRender_t::writeShader(const string &shader_name, Material* matr, ostr << "\t\tray_mirror << "\" />\n"; float fo = 1.f-(matr->fresnel_mir_i-1.f)*0.25f; // blender param range [1,5], also here reversed (1 in Blender -> no fresnel) ostr << "\t\t\n"; - // transmit absorption color - // to make things easier(?) for user it now specifies the actual color at 1 unit / YF_dscale of distance - const float maxlog = -log(1e-38); - float ar = (matr->YF_ar>0) ? -log(matr->YF_ar) : maxlog; - float ag = (matr->YF_ag>0) ? -log(matr->YF_ag) : maxlog; - float ab = (matr->YF_ab>0) ? -log(matr->YF_ab) : maxlog; - float sc = matr->YF_dscale; - if (sc!=0.f) sc=1.f/sc; - ostr << "\t\t\n"; - // dispersion - ostr << "\t\tYF_dpwr << "\" />\n"; - ostr << "\t\tYF_dsmp << "\" />\n"; - ostr << "\t\tYF_djit ? "on" : "off") << "\" />\n"; // for backward compatibility, also add old 'reflected' parameter, copy of mirror_color ostr << "\t\tmirr << "\" g=\"" << matr->mirg << "\" b=\"" << matr->mirb << "\" />\n"; @@ -720,6 +707,21 @@ void yafrayFileRender_t::writeShader(const string &shader_name, Material* matr, ostr << "\t\tfilter << "\" />\n"; // tir on by default ostr << "\t\t\n"; + + // transmit absorption color + // to make things easier(?) for user it now specifies the actual color at 1 unit / YF_dscale of distance + const float maxlog = -log(1e-38); + float ar = (matr->YF_ar>0) ? -log(matr->YF_ar) : maxlog; + float ag = (matr->YF_ag>0) ? -log(matr->YF_ag) : maxlog; + float ab = (matr->YF_ab>0) ? -log(matr->YF_ab) : maxlog; + float sc = matr->YF_dscale; + if (sc!=0.f) sc=1.f/sc; + ostr << "\t\t\n"; + // dispersion + ostr << "\t\tYF_dpwr << "\" />\n"; + ostr << "\t\tYF_dsmp << "\" />\n"; + ostr << "\t\tYF_djit ? "on" : "off") << "\" />\n"; + // for backward compatibility, also add old 'transmitted' parameter, copy of 'color' * (1-alpha) float na = 1.f-matr->alpha; ostr << "\t\tr*na << "\" g=\"" << matr->g*na << "\" b=\"" << matr->b*na << "\" />\n"; -- cgit v1.2.3