Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Conty Estevez <conty@yafray.org>2004-01-24 15:23:41 +0300
committerAlejandro Conty Estevez <conty@yafray.org>2004-01-24 15:23:41 +0300
commit79884ff70b10b446eb0a871ad574e9689831ad8a (patch)
tree1e1516a8bbe15597a65855039aded796048be316 /source/blender/yafray
parent38c0f593a8c767109351af15202626f5896d1471 (diff)
Added another control for new pathlight refinement parameter and solved
a problem with name collision betwen textures and shaders reported by kino.
Diffstat (limited to 'source/blender/yafray')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp15
-rw-r--r--source/blender/yafray/intern/yafray_Render.cpp6
2 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index b9636e0fd3f..4e85260756c 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -400,7 +400,9 @@ void yafrayFileRender_t::writeMaterialsAndModulators()
Tex* tex = mtex->tex;
if (tex==NULL) continue;
- map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name+2));
+ //map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name+2));
+ // now included the full name
+ map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name));
if (mtexL!=used_textures.end()) {
ostr.str("");
ostr << "<shader type=\"blendermapper\" name=\"" << blendmat->first + "_map" << m <<"\"";
@@ -572,7 +574,8 @@ void yafrayFileRender_t::writeMaterialsAndModulators()
Tex* tex = mtex->tex;
if (tex==NULL) continue;
- map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name+2));
+ //map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name+2));
+ map<string, pair<Material*, MTex*> >::const_iterator mtexL = used_textures.find(string(tex->id.name));
if (mtexL!=used_textures.end()) {
ostr.str("");
@@ -717,7 +720,8 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
ostr <<" shadow=\""<< (shadow ? "on" : "off" )<<"\" ";
if (VLR_list[0]->mat->mode & MA_RAYTRANSP)
ostr << "caus_IOR=\"" << VLR_list[0]->mat->ang << "\" ";
- if (strlen(matname)==0) matname = "blender_default"; else matname+=2; //skip MA id
+ if (strlen(matname)==0) matname = "blender_default";
+ //else matname+=2; //skip MA id
ostr << " shader_name=\"" << matname << "\" >\n";
ostr << "\t<attributes>\n";
if (VLR_list[0]->mat->mode & MA_RAYTRANSP)
@@ -837,7 +841,8 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
Material* fmat = vlr->mat;
bool EXPORT_VCOL = ((fmat->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))!=0);
char* fmatname = fmat->id.name;
- if (strlen(fmatname)==0) fmatname = "blender_default"; else fmatname+=2; //skip MA id
+ if (strlen(fmatname)==0) fmatname = "blender_default";
+ //else fmatname+=2; //skip MA id
TFace* uvc = vlr->tface; // possible uvcoords (v upside down)
int idx1, idx2, idx3;
@@ -1168,7 +1173,7 @@ void yafrayFileRender_t::writePathlight()
float aspect = 1;
if (R.r.xsch < R.r.ysch) aspect = float(R.r.xsch)/float(R.r.ysch);
float sbase = 2.0*atan(0.5/(mainCamLens/(aspect*32.0)))/float(R.r.xsch);
- ostr << " cache=\"on\" use_QMC=\"on\" \n";
+ ostr << " cache=\"on\" use_QMC=\"on\" threshold=\"" <<R.r.GIrefinement<<"\""<<endl;
ostr << " cache_size=\"" << sbase*R.r.GIpixelspersample << "\" shadow_threshold=\"" <<
1.0 - R.r.GIshadowquality << "\" grid=\"82\" search=\"35\" gradient=\"" <<
((R.r.GIgradient)? "on" : "off") << "\" >\n";
diff --git a/source/blender/yafray/intern/yafray_Render.cpp b/source/blender/yafray/intern/yafray_Render.cpp
index a8f6746f36e..39f5e6da524 100644
--- a/source/blender/yafray/intern/yafray_Render.cpp
+++ b/source/blender/yafray/intern/yafray_Render.cpp
@@ -101,7 +101,8 @@ bool yafrayRender_t::getAllMatTexObs()
if (strlen(matr->id.name)==0)
used_materials["blender_default"] = matr;
else
- used_materials[matr->id.name+2] = matr; // skip 'MA' id
+ used_materials[matr->id.name] = matr; // <-- full name to avoid name collision in yafray
+ //used_materials[matr->id.name+2] = matr; // skip 'MA' id
// textures, all active channels
for (int m=0;m<8;m++) {
if (matr->septex & (1<<m)) continue; // only active channels
@@ -120,7 +121,8 @@ bool yafrayRender_t::getAllMatTexObs()
(txtp!=TEX_IMAGE)) continue;
// in the case of an image texture, check that there is an actual image, otherwise ignore
if ((txtp & TEX_IMAGE) && (!tx->ima)) continue;
- used_textures[tx->id.name+2] = make_pair(matr, mx);
+ used_textures[tx->id.name] = make_pair(matr, mx); // <-- full name to avoid name collision in yafray
+ //used_textures[tx->id.name+2] = make_pair(matr, mx);
}
}