[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27208] trunk/blender/source/blender: Fix #21227, #21346 and #21336: image texture wasn't centered correctly
Brecht Van Lommel
brecht at blender.org
Mon Mar 1 19:11:09 CET 2010
Revision: 27208
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27208
Author: blendix
Date: 2010-03-01 19:11:09 +0100 (Mon, 01 Mar 2010)
Log Message:
-----------
Fix #21227, #21346 and #21336: image texture wasn't centered correctly
when sculpting and using it from material nodes.
Modified Paths:
--------------
trunk/blender/source/blender/gpu/intern/gpu_material.c
trunk/blender/source/blender/makesdna/DNA_texture_types.h
trunk/blender/source/blender/render/intern/source/texture.c
trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
Modified: trunk/blender/source/blender/gpu/intern/gpu_material.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_material.c 2010-03-01 17:53:33 UTC (rev 27207)
+++ trunk/blender/source/blender/gpu/intern/gpu_material.c 2010-03-01 18:11:09 UTC (rev 27208)
@@ -1026,9 +1026,7 @@
if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
if((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP)) {
- tex->norfac = mtex->norfac;
-
- if(tex->norfac < 0.0f)
+ if(mtex->norfac < 0.0f)
GPU_link(mat, "mtex_negate_texnormal", tnor, &tnor);
if(mtex->normapspace == MTEX_NSPACE_TANGENT)
Modified: trunk/blender/source/blender/makesdna/DNA_texture_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_texture_types.h 2010-03-01 17:53:33 UTC (rev 27207)
+++ trunk/blender/source/blender/makesdna/DNA_texture_types.h 2010-03-01 18:11:09 UTC (rev 27208)
@@ -236,7 +236,7 @@
int frames, offset, sfra;
float checkerdist, nabla;
- float norfac;
+ float pad1;
struct ImageUser iuser;
Modified: trunk/blender/source/blender/render/intern/source/texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/texture.c 2010-03-01 17:53:33 UTC (rev 27207)
+++ trunk/blender/source/blender/render/intern/source/texture.c 2010-03-01 18:11:09 UTC (rev 27208)
@@ -1311,18 +1311,18 @@
localmtex.object= NULL;
localmtex.texco= TEXCO_ORCO;
- VECCOPY(texvec_l, texvec);
+ copy_v3_v3(texvec_l, texvec);
if(dxt && dyt) {
- VECCOPY(dxt_l, dxt);
- VECCOPY(dyt_l, dyt);
+ copy_v3_v3(dxt_l, dxt);
+ copy_v3_v3(dyt_l, dyt);
}
else {
- dxt_l[0]= dxt_l[1]= dxt_l[2]= 0.0f;
- dyt_l[0]= dyt_l[1]= dyt_l[2]= 0.0f;
+ zero_v3(dxt_l);
+ zero_v3(dyt_l);
}
do_2d_mapping(&localmtex, texvec_l, NULL, NULL, dxt_l, dyt_l);
- rgbnor= multitex(tex, texvec, dxt_l, dyt_l, osatex, texres, thread, which_output);
+ rgbnor= multitex(tex, texvec_l, dxt_l, dyt_l, osatex, texres, thread, which_output);
}
return rgbnor;
@@ -2119,19 +2119,18 @@
}
if( (mtex->mapto & MAP_NORM) ) {
if(texres.nor) {
- tex->norfac= mtex->norfac;
+ float norfac= mtex->norfac;
/* we need to code blending modes for normals too once.. now 1 exception hardcoded */
if ((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP)) {
/* qdn: for normalmaps, to invert the normalmap vector,
it is better to negate x & y instead of subtracting the vector as was done before */
- tex->norfac = mtex->norfac;
- if (tex->norfac < 0.0f) {
+ if (norfac < 0.0f) {
texres.nor[0] = -texres.nor[0];
texres.nor[1] = -texres.nor[1];
}
- fact = Tnor*fabs(tex->norfac);
+ fact = Tnor*fabs(norfac);
if (fact>1.f) fact = 1.f;
facm = 1.f-fact;
if(mtex->normapspace == MTEX_NSPACE_TANGENT) {
@@ -2179,15 +2178,15 @@
float nor[3], dot;
if(shi->mat->mode & MA_TANGENT_V) {
- shi->tang[0]+= Tnor*tex->norfac*texres.nor[0];
- shi->tang[1]+= Tnor*tex->norfac*texres.nor[1];
- shi->tang[2]+= Tnor*tex->norfac*texres.nor[2];
+ shi->tang[0]+= Tnor*norfac*texres.nor[0];
+ shi->tang[1]+= Tnor*norfac*texres.nor[1];
+ shi->tang[2]+= Tnor*norfac*texres.nor[2];
}
/* prevent bump to become negative normal */
- nor[0]= Tnor*tex->norfac*texres.nor[0];
- nor[1]= Tnor*tex->norfac*texres.nor[1];
- nor[2]= Tnor*tex->norfac*texres.nor[2];
+ nor[0]= Tnor*norfac*texres.nor[0];
+ nor[1]= Tnor*norfac*texres.nor[1];
+ nor[2]= Tnor*norfac*texres.nor[2];
dot= 0.5f + 0.5f*INPR(nor, shi->vn);
@@ -2212,11 +2211,11 @@
/* Now that most textures offer both Nor and Intensity, allow */
/* both to work, and let user select with slider. */
if(texres.nor) {
- tex->norfac= mtex->norfac;
+ float norfac= mtex->norfac;
- shi->displace[0]+= 0.2f*Tnor*tex->norfac*texres.nor[0];
- shi->displace[1]+= 0.2f*Tnor*tex->norfac*texres.nor[1];
- shi->displace[2]+= 0.2f*Tnor*tex->norfac*texres.nor[2];
+ shi->displace[0]+= 0.2f*Tnor*norfac*texres.nor[0];
+ shi->displace[1]+= 0.2f*Tnor*norfac*texres.nor[1];
+ shi->displace[2]+= 0.2f*Tnor*norfac*texres.nor[2];
}
if(rgbnor & TEX_RGB) {
Modified: trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
===================================================================
--- trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c 2010-03-01 17:53:33 UTC (rev 27207)
+++ trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c 2010-03-01 18:11:09 UTC (rev 27208)
@@ -325,8 +325,8 @@
CSG_VertexIteratorDescriptor obBVertices)
{ return 0;}
-const char * build_date= "";
-const char * build_time= "";
-const char * build_rev= "";
-const char * build_platform= "";
-const char * build_type= "";
+extern const char * build_date;
+extern const char * build_time;
+extern const char * build_rev;
+extern const char * build_platform;
+extern const char * build_type;
More information about the Bf-blender-cvs
mailing list