diff options
author | Ton Roosendaal <ton@blender.org> | 2007-12-03 19:06:34 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-12-03 19:06:34 +0300 |
commit | 0412d623097b15dd5e63a500afb3ed2c56b2f20b (patch) | |
tree | ac79d8c6d6b378ae2a610eb0dd17800af4f82187 /source/blender/render | |
parent | 9f4cc0b46b6148409c55b6f66eff36dab437b2eb (diff) |
Blending mode "Overlay" was not coded yet for material blending.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/texture.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index accd39170e4..41a46679e95 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1272,6 +1272,24 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg in[2]= 1.0 - (facm+fact*(1.0-tex[2])) * (1.0-out[2]); break; + case MTEX_OVERLAY: + fact*= facg; + facm= 1.0-facg; + + if(out[0] < 0.5f) + in[0] = out[0] * (facm + 2.0f*fact*tex[0]); + else + in[0] = 1.0f - (facm + 2.0f*fact*(1.0 - tex[0])) * (1.0 - out[0]); + if(out[1] < 0.5f) + in[1] = out[1] * (facm + 2.0f*fact*tex[1]); + else + in[1] = 1.0f - (facm + 2.0f*fact*(1.0 - tex[1])) * (1.0 - out[1]); + if(out[2] < 0.5f) + in[2] = out[2] * (facm + 2.0f*fact*tex[2]); + else + in[2] = 1.0f - (facm + 2.0f*fact*(1.0 - tex[2])) * (1.0 - out[2]); + break; + case MTEX_SUB: fact= -fact; case MTEX_ADD: |