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:
@@ -430,10 +430,10 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
|
|||||||
mul_m4_v3(R.viewinv, shi->gl);
|
mul_m4_v3(R.viewinv, shi->gl);
|
||||||
|
|
||||||
if(shi->osatex) {
|
if(shi->osatex) {
|
||||||
VECCOPY(shi->dxgl, shi->dxco);
|
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);
|
VECCOPY(shi->dygl, shi->dyco);
|
||||||
mul_m3_v3(R.imat, shi->dyco);
|
mul_mat3_m4_v3(R.viewinv, shi->dygl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1012,13 +1012,10 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
|||||||
VECCOPY(shi->gl, shi->co);
|
VECCOPY(shi->gl, shi->co);
|
||||||
mul_m4_v3(R.viewinv, shi->gl);
|
mul_m4_v3(R.viewinv, shi->gl);
|
||||||
if(shi->osatex) {
|
if(shi->osatex) {
|
||||||
VECCOPY(shi->dxgl, shi->dxco);
|
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_mat3_m4_v3(R.viewinv, shi->dxgl);
|
||||||
//mul_m3_v3(R.imat, shi->dxco);
|
VECCOPY(shi->dygl, shi->dyco);
|
||||||
mul_mat3_m4_v3(R.viewinv, shi->dxco);
|
mul_mat3_m4_v3(R.viewinv, shi->dygl);
|
||||||
VECCOPY(shi->dygl, shi->dyco);
|
|
||||||
//mul_m3_v3(R.imat, shi->dyco);
|
|
||||||
mul_mat3_m4_v3(R.viewinv, shi->dyco);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user