forked from bartvdbraak/blender
Bug fix: Halos didn't use texture alpha
This commit is contained in:
parent
3e7469cd01
commit
b5c2f9df95
@ -1048,7 +1048,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
|||||||
MTex *mtex;
|
MTex *mtex;
|
||||||
float tin, tr, tg, tb, ta;
|
float tin, tr, tg, tb, ta;
|
||||||
float xn, yn, zn, texvec[3], hoco[4], hoco1[4], in[3],tex[3],out[3];
|
float xn, yn, zn, texvec[3], hoco[4], hoco1[4], in[3],tex[3],out[3];
|
||||||
int i;
|
int i, hasrgb;
|
||||||
|
|
||||||
if(hasize==0.0) return NULL;
|
if(hasize==0.0) return NULL;
|
||||||
|
|
||||||
@ -1151,7 +1151,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
|||||||
VECCOPY(texvec, orco);
|
VECCOPY(texvec, orco);
|
||||||
}
|
}
|
||||||
|
|
||||||
externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
|
hasrgb = externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
|
||||||
|
|
||||||
//yn= tin*mtex->colfac;
|
//yn= tin*mtex->colfac;
|
||||||
//zn= tin*mtex->alphafac;
|
//zn= tin*mtex->alphafac;
|
||||||
@ -1172,6 +1172,11 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
|||||||
har->g= in[1];
|
har->g= in[1];
|
||||||
har->b= in[2];
|
har->b= in[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* alpha returned, so let's use it instead of intensity */
|
||||||
|
if(hasrgb)
|
||||||
|
tin = ta;
|
||||||
|
|
||||||
if(mtex->mapto & MAP_ALPHA)
|
if(mtex->mapto & MAP_ALPHA)
|
||||||
har->alfa = texture_value_blend(mtex->def_var,har->alfa,tin,mtex->alphafac,mtex->blendtype);
|
har->alfa = texture_value_blend(mtex->def_var,har->alfa,tin,mtex->alphafac,mtex->blendtype);
|
||||||
if(mtex->mapto & MAP_HAR)
|
if(mtex->mapto & MAP_HAR)
|
||||||
|
Loading…
Reference in New Issue
Block a user