Archived

This topic is now archived and is closed to further replies.

zroobavela

texture blending

Recommended Posts

zroobavela    122
Hi, I am new to blending. I need to blend two textures as follows: T1 = texture #1 (RGB) T2 = texture #2 (RGB) F1 = fragment #1 (RGB) F2 = fragment #2 (RGB) OUT = Final blended output T1 * F1 + T2 * F2 I would appreciate any help/hint/direction... thx

Share this post


Link to post
Share on other sites
zroobavela    122
a little more detail

I am trying to blend these two textures as I described. I cant find the support for such a blend.

I am trying to do this in one pass (using multitexturing).

modulating seems to take the first texture as the fragment for the second texture, like so:

out = F1 * T1 * T2.

opengl blending seems to do the following:
F1 * (1 - T1 ) + F2 * T2

whereas I need

F1 * T1 + F2 * T2.

I took a look at ARB_texture_env_add.
but this just wants to add the fragment to the texture.

does anyone know how to implement the blend function I need, namely F1 * T1 + F2 * T2?

thx

Share this post


Link to post
Share on other sites
zedzeek    529
opengl doesnt really have 2 fragments perhaps u can simulate this with another texture or seconday colour or (constant colour though i dont think u will be able to change this heaps if u care about performance)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You''ll need to do two passes.

In the first pass, do F1 * T1.
Then set the blending to add to the destination, and do F2 * T2.

Share this post


Link to post
Share on other sites