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>2012-06-22 11:49:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-22 11:49:44 +0400
commit226c86ae58cdf292fd415db05c05fba46375738d (patch)
tree3f002f89da94cc0428529f469175c311d0341561 /source/blender/render
parentec3399efa6882ea5a8fe023092c0918ee7b135d9 (diff)
use an inline function for rgb -> bw conversion.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/render_texture.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index f6fe8e8974d..e2a4ef1dca8 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -2852,7 +2852,7 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
/* texture output */
if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
- texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ texres.tin = rgb_to_bw(&texres.tr);
rgb= 0;
}
if (mtex->texflag & MTEX_NEGATIVE) {
@@ -2919,7 +2919,7 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
if (mtex->mapto & MAP_ALPHA) {
if (rgb) {
if (texres.talpha) texres.tin= texres.ta;
- else texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ else texres.tin = rgb_to_bw(&texres.tr);
}
col_r[3]*= texres.tin;
@@ -3051,7 +3051,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
/* texture output */
if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
- texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ texres.tin = rgb_to_bw(&texres.tr);
rgb= 0;
}
if (mtex->texflag & MTEX_NEGATIVE) {
@@ -3124,7 +3124,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
}
}
if (mtex->mapto & WOMAP_BLEND) {
- if (rgb) texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ if (rgb) texres.tin = rgb_to_bw(&texres.tr);
*blend= texture_value_blend(mtex->def_var, *blend, texres.tin, mtex->blendfac, mtex->blendtype);
}
@@ -3264,7 +3264,7 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
/* texture output */
if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
- texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ texres.tin = rgb_to_bw(&texres.tr);
rgb= 0;
}
if (mtex->texflag & MTEX_NEGATIVE) {
@@ -3358,7 +3358,7 @@ int externtex(MTex *mtex, const float vec[3], float *tin, float *tr, float *tg,
rgb= multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output);
if (rgb) {
- texr.tin= (0.35f*texr.tr+0.45f*texr.tg+0.2f*texr.tb);
+ texr.tin = rgb_to_bw(&texr.tr);
}
else {
texr.tr= mtex->r;