diff options
author | Ton Roosendaal <ton@blender.org> | 2011-02-06 21:38:53 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-02-06 21:38:53 +0300 |
commit | c03064b1870825e96e6b4e910759a79e972e552b (patch) | |
tree | f77f6f82b2af6c1f1b8345515936bcc443667964 /source | |
parent | 216f9af08e88398b7e2f805d241734ec80879180 (diff) |
Bugfix #25953
Fix in crashing displacement last friday, assumed wrongly that
the old 'new bump' failed for displacement too. It still did
work (somewhat). This restores the situation again.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index a62c4bd8e74..506f1495c28 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -2080,6 +2080,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T void do_material_tex(ShadeInput *shi) { + CompatibleBump compat_bump; + NTapBump ntap_bump; MTex *mtex; Tex *tex; TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; @@ -2087,9 +2089,6 @@ void do_material_tex(ShadeInput *shi) float fact, facm, factt, facmm, stencilTin=1.0; float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3]={0.0f, 0.0f, 0.0f}, Tnor=1.0; int tex_nr, rgbnor= 0, warpdone=0; - - CompatibleBump compat_bump; - NTapBump ntap_bump; int use_compat_bump, use_ntap_bump; compatible_bump_init(&compat_bump); @@ -2113,11 +2112,16 @@ void do_material_tex(ShadeInput *shi) use_ntap_bump= (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)); /* XXX texture node trees don't work for this yet */ - /* it also needs derivatives */ - if((tex->nodetree && tex->use_nodes) || shi->osatex==0) { + if(tex->nodetree && tex->use_nodes) { use_compat_bump = 0; use_ntap_bump = 0; } + + /* case displacement mapping */ + if(shi->osatex==0 && use_ntap_bump) { + use_ntap_bump = 0; + use_compat_bump = 1; + } /* which coords */ if(mtex->texco==TEXCO_ORCO) { |