forked from bartvdbraak/blender
Bug fix #2323
The addition in 2.36 to correct bumpmapping for View and Object rotation, made many nice bumpmap setups in older files less nice. Especially apparent when you apply "flipped" mappings in "Map Input" Panel, like map the X to Z and the Z to X. A correction then gives wrong results. Since the "correct bumpmapping" is actually a new option, causing extra rendertime too, I've made it an option now. With the "Map To" Panel being fully used, I've put the new button option (temporally I hope) in the first "Texture" Panel in material context. Will be updated in release log page!
This commit is contained in:
parent
1bde293997
commit
5f237e67cc
@ -283,6 +283,7 @@ typedef struct Tex {
|
||||
#define MTEX_STENCIL 2
|
||||
#define MTEX_NEGATIVE 4
|
||||
#define MTEX_ALPHAMIX 8
|
||||
#define MTEX_VIEWSPACE 16
|
||||
|
||||
/* blendtype */
|
||||
#define MTEX_BLEND 0
|
||||
|
@ -1620,11 +1620,10 @@ void do_material_tex(ShadeInput *shi)
|
||||
warpvec[2]= mtex->warpfac*texres.nor[2];
|
||||
warpdone= 1;
|
||||
}
|
||||
#if 0
|
||||
// rotate to global coords
|
||||
if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
|
||||
// hrms, for sphere/tube map this rotating doesn't work nice
|
||||
if(mtex->mapping==MTEX_FLAT || mtex->mapping==MTEX_CUBE) {
|
||||
|
||||
if(mtex->texflag & MTEX_VIEWSPACE) {
|
||||
// rotate to global coords
|
||||
if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
|
||||
if(shi->vlr && shi->vlr->ob) {
|
||||
float len= Normalise(texres.nor);
|
||||
// can be optimized... (ton)
|
||||
@ -1635,7 +1634,6 @@ void do_material_tex(ShadeInput *shi)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* mapping */
|
||||
@ -1726,10 +1724,10 @@ void do_material_tex(ShadeInput *shi)
|
||||
}
|
||||
|
||||
if(mtex->maptoneg & MAP_DISPLACE) {
|
||||
factt= (0.5-texres.tin)*mtex->dispfac; facmm= 1.0-factt;
|
||||
factt= (texres.tin-0.5)*mtex->dispfac; facmm= 1.0-factt;
|
||||
}
|
||||
else {
|
||||
factt= (texres.tin-0.5)*mtex->dispfac; facmm= 1.0-factt;
|
||||
factt= (0.5-texres.tin)*mtex->dispfac; facmm= 1.0-factt;
|
||||
}
|
||||
|
||||
if(mtex->blendtype==MTEX_BLEND) {
|
||||
|
@ -2774,7 +2774,10 @@ static void material_panel_texture(Material *ma)
|
||||
else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,130,21,20, 0, 0, 0, 0, 0, "");
|
||||
}
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefBut(block, BUT, B_TEXCLEAR, "Clear", 122, 130, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture");
|
||||
uiDefBut(block, BUT, B_TEXCLEAR, "Clear", 122, 130, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture");
|
||||
|
||||
uiDefButS(block, TOG|BIT|4, B_DIFF, "Correct Nor Map", 100,18,163,19, &(mtex->texflag), 0, 0, 0, 0, "This channel will correct normal mapping for View space and Object space");
|
||||
|
||||
}
|
||||
else
|
||||
uiDefButS(block, TOG, B_EXTEXBROWSE, "Add New" ,100, 150, 163, 20, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock");
|
||||
|
Loading…
Reference in New Issue
Block a user