Fix for rendering procedual bump maps, mapped in world space, since the new bump map kernel uses direction, this bug became a real issue, with bumps suddenly changing direction

Fix provided due to a long session on IRC with Morten S. Mikkelsen (sparky_)
This commit is contained in:
Michael Fox
2011-02-09 01:21:03 +00:00
parent f56d1a5e2c
commit 2a67a126e8

View File

@@ -431,9 +431,9 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
if(shi->osatex) {
VECCOPY(shi->dxgl, shi->dxco);
mul_m3_v3(R.imat, shi->dxco);
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
VECCOPY(shi->dygl, shi->dyco);
mul_m3_v3(R.imat, shi->dyco);
mul_mat3_m4_v3(R.viewinv, shi->dygl);
}
}
@@ -1013,12 +1013,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
mul_m4_v3(R.viewinv, shi->gl);
if(shi->osatex) {
VECCOPY(shi->dxgl, shi->dxco);
// TXF: bug was here, but probably should be in convertblender.c, R.imat only valid if there is a world
//mul_m3_v3(R.imat, shi->dxco);
mul_mat3_m4_v3(R.viewinv, shi->dxco);
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
VECCOPY(shi->dygl, shi->dyco);
//mul_m3_v3(R.imat, shi->dyco);
mul_mat3_m4_v3(R.viewinv, shi->dyco);
mul_mat3_m4_v3(R.viewinv, shi->dygl);
}
}