Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-23 16:03:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-23 16:03:34 +0400
commitf88ad3f04894d37028bb35ffdbd39636d57a37cb (patch)
treecdafaf6f6384c89fc622714ac9289ac1dabccfb3 /source/blender
parent6fdd00f7096aff680641177a3820473de050a3b6 (diff)
bugfix [#23595] Texture paint with a node based brush produces artifacts
also changed displace modifier not to link object depgraph when not using object texturespace.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_brush.h2
-rw-r--r--source/blender/blenkernel/intern/brush.c16
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c2
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c4
-rw-r--r--source/blender/render/extern/include/RE_render_ext.h2
-rw-r--r--source/blender/render/intern/source/renderdatabase.c4
-rw-r--r--source/blender/render/intern/source/texture.c4
12 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 0e406a16d0c..25d0eb5bc36 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -62,7 +62,7 @@ float brush_curve_strength_clamp(struct Brush *br, float p, const float len);
float brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
/* sampling */
-void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
+void brush_sample_tex(struct Brush *brush, float *xy, float *rgba, const int thread);
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
struct ImBuf **imbuf);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 90ea562be9d..c67db9382f3 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -480,7 +480,7 @@ int brush_clone_image_delete(Brush *brush)
}
/* Brush Sampling */
-void brush_sample_tex(Brush *brush, float *xy, float *rgba)
+void brush_sample_tex(Brush *brush, float *xy, float *rgba, const int thread)
{
MTex *mtex= &brush->mtex;
@@ -493,7 +493,7 @@ void brush_sample_tex(Brush *brush, float *xy, float *rgba)
co[1]= xy[1]/radius;
co[2]= 0.0f;
- hasrgb= externtex(mtex, co, &tin, &tr, &tg, &tb, &ta);
+ hasrgb= externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, thread);
if (hasrgb) {
rgba[0]= tr;
@@ -547,12 +547,12 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
dstf[3]= alpha*brush_curve_strength_clamp(brush, dist, radius);
}
else if (texfall == 1) {
- brush_sample_tex(brush, xy, dstf);
+ brush_sample_tex(brush, xy, dstf, 0);
}
else {
dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
- brush_sample_tex(brush, xy, rgba);
+ brush_sample_tex(brush, xy, rgba, 0);
dstf[0] = rgba[0]*brush->rgb[0];
dstf[1] = rgba[1]*brush->rgb[1];
@@ -583,7 +583,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
dst[3]= FTOCHAR(alpha*brush_curve_strength(brush, dist, radius));
}
else if (texfall == 1) {
- brush_sample_tex(brush, xy, rgba);
+ brush_sample_tex(brush, xy, rgba, 0);
dst[0]= FTOCHAR(rgba[0]);
dst[1]= FTOCHAR(rgba[1]);
dst[2]= FTOCHAR(rgba[2]);
@@ -592,7 +592,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
else {
dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
- brush_sample_tex(brush, xy, rgba);
+ brush_sample_tex(brush, xy, rgba, 0);
dst[0] = FTOCHAR(rgba[0]*brush->rgb[0]);
dst[1] = FTOCHAR(rgba[1]*brush->rgb[1]);
dst[2] = FTOCHAR(rgba[2]*brush->rgb[2]);
@@ -739,7 +739,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i
xy[0] = x + xoff;
xy[1] = y + yoff;
- brush_sample_tex(brush, xy, tf);
+ brush_sample_tex(brush, xy, tf, 0);
}
bf[0] = tf[0]*mf[0];
@@ -770,7 +770,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i
xy[0] = x + xoff;
xy[1] = y + yoff;
- brush_sample_tex(brush, xy, rgba);
+ brush_sample_tex(brush, xy, rgba, 0);
t[0]= FTOCHAR(rgba[0]);
t[1]= FTOCHAR(rgba[1]);
t[2]= FTOCHAR(rgba[2]);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 07b712c4330..6b75f5d417c 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3686,7 +3686,7 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float
else
VECCOPY(texco,orco);
- externtex(mtex, texco, &value, rgba, rgba+1, rgba+2, rgba+3);
+ externtex(mtex, texco, &value, rgba, rgba+1, rgba+2, rgba+3, 0);
if((event & mtex->pmapto) & MAP_PA_TIME){
if((setvars&MAP_PA_TIME)==0){
ptex->time=0.0;
@@ -3740,7 +3740,7 @@ void psys_get_texture(ParticleSimulationData *sim, Material *ma, ParticleData *p
psys_particle_on_emitter(sim->psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,0,0,0,texco, 0);
}
- externtex(mtex, texco, &value, rgba, rgba+1, rgba+2, rgba+3);
+ externtex(mtex, texco, &value, rgba, rgba+1, rgba+2, rgba+3, 0);
if((event & mtex->pmapto) & MAP_PA_TIME){
/* the first time has to set the base value for time regardless of blend mode */
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index bc1cdea7d50..7316e24ce65 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -4450,7 +4450,7 @@ void vertexnoise(Object *obedit, EditMesh *em)
}
else {
float tin, dum;
- externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum);
+ externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0);
eve->co[2]+= 0.05*tin;
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index e7a06f27f67..6e921b57d9d 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -3757,7 +3757,7 @@ static void *do_projectpaint_thread(void *ph_v)
if (falloff > 0.0f) {
if (ps->is_texbrush) {
- brush_sample_tex(ps->brush, projPixel->projCoSS, rgba);
+ brush_sample_tex(ps->brush, projPixel->projCoSS, rgba, thread_index);
alpha = rgba[3];
} else {
alpha = 1.0f;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 10af35a1b4b..2e192a08ca5 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -724,7 +724,7 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa
/* Get strength by feeding the vertex
location directly into a texture */
externtex(mtex, point, &avg,
- &jnk, &jnk, &jnk, &jnk);
+ &jnk, &jnk, &jnk, &jnk, 0);
}
else if(ss->texcache) {
float rotation = -mtex->rot;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index aa12eb97e12..e83a17cc277 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1306,7 +1306,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "texmapping");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index 29ace805543..efe57410441 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -134,7 +134,7 @@ static void updateDepgraph(
{
DisplaceModifierData *dmd = (DisplaceModifierData*) md;
- if(dmd->map_object) {
+ if(dmd->map_object && dmd->texmapping == MOD_DISP_MAP_OBJECT) {
DagNode *curNode = dag_get_node(forest, dmd->map_object);
dag_add_relation(forest, curNode, obNode,
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index a6d99ad72ae..ee608c7cf31 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -442,11 +442,11 @@ static DerivedMesh *applyModifier(ModifierData *md,
j= 2;
}
- for(; j>=0; j--) {
+ do {
vidx = *(&mf->v1 + j);
vert_accum[vidx] += face_angles[j];
vert_angles[vidx]+= shell_angle_to_dist(angle_normalized_v3v3(vert_nors[vidx], face_nors[i])) * face_angles[j];
- }
+ } while(j--);
}
/* vertex group support */
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h
index 98720897e8e..b04f7247e2a 100644
--- a/source/blender/render/extern/include/RE_render_ext.h
+++ b/source/blender/render/extern/include/RE_render_ext.h
@@ -51,7 +51,7 @@ struct ImBuf;
//void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re);
/* particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */
-int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta);
+int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta, const int thread);
/* particle.c */
void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype);
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index ce55935d392..91d58b7943e 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -1019,7 +1019,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
}
}
- externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta);
+ externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
yn= tin*mtex->colfac;
zn= tin*mtex->alphafac;
@@ -1151,7 +1151,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
VECCOPY(texvec, orco);
}
- externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta);
+ externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
//yn= tin*mtex->colfac;
//zn= tin*mtex->alphafac;
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 0e98069f884..be2c83a7edf 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -3016,7 +3016,7 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
/* ------------------------------------------------------------------------- */
-int externtex(MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta)
+int externtex(MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta, const int thread)
{
Tex *tex;
TexResult texr;
@@ -3042,7 +3042,7 @@ int externtex(MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *t
do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
}
- rgb= multitex(tex, texvec, dxt, dyt, 0, &texr, 0, mtex->which_output);
+ rgb= multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output);
if(rgb) {
texr.tin= (0.35*texr.tr+0.45*texr.tg+0.2*texr.tb);