Bug fix #2640
authorTon Roosendaal <ton@blender.org>
Sun, 29 May 2005 10:44:52 +0000 (10:44 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 29 May 2005 10:44:52 +0000 (10:44 +0000)
Somehow displacement got negated in my commit of april 12. Regression file
showed it, thanks efbie for finding it! :)

source/blender/render/intern/source/texture.c

index 78cb65b5ff07251fee9972a4c52c11662b0bc95c..7f02260bfd719392efd3c46cf2e9e4b96a416abe 100644 (file)
@@ -1724,10 +1724,10 @@ void do_material_tex(ShadeInput *shi)
                                }
 
                                if(mtex->maptoneg & MAP_DISPLACE) {
-                                       factt= (texres.tin-0.5)*mtex->dispfac; facmm= 1.0-factt;
+                                       factt= (0.5-texres.tin)*mtex->dispfac; facmm= 1.0-factt;
                                }
                                else {
-                                       factt= (0.5-texres.tin)*mtex->dispfac; facmm= 1.0-factt;
+                                       factt= (texres.tin-0.5)*mtex->dispfac; facmm= 1.0-factt;
                                }
 
                                if(mtex->blendtype==MTEX_BLEND) {