Re: (originally no subject) Texturing modes

New Message Reply Date view Thread view Subject view Author view

Moshe Nissim (moshe++at++orad.co.il)
Mon, 08 Jun 1998 10:17:16 +0300


Prakash Mahesh wrote:

> --
> We have been attempting to combine different texturing modes (a
> mixture of modulate and decal) in Performer to allow for the following
> behavior for 4 channel texture images:
> C = (1-At)Cf + At(Ct)
> A = At
> where At is the alpha channel for the texel,
> Cf is the color of the fragment,
> and Ct is the color of the texel.
>
> This differs from the standard approach which is:
> C = (1-At)Cf + At(Ct)
> A = Af ****
> where At is the alpha channel for the texel,
> Af is the alpha channel for the fragment,
> Cf is the color of the fragment,
> and Ct is the color of the texel.
>
> Is there a simple way to achieve such functionality when using
> Performer on top of OpenGL?
>

That would wonderful to have in OpenGL, wouldn't it?I guess you too are trying to overcome the OpenGL way of "mixing"
lighting+material color with texture color by multiplication.
The standard approach that you mention is GL_DECAL in glTexEnv,
with four-channel texture. However, not only is the
framebuffer alpha affected (which can be worked around by subsequent
rendering into the same area, or by disabling writes into the framebuffer
alpha channel), but you also have to sacrifice the texture
alpha channel for this constant value. This means you cannot combine
this with a RGBA texture that modulates the alpha. Looking at the glTexEnv
table, I see no other equation that blends Cf and Ct.
The only thing that comes close is the GL_ADD with RGB texture, which does
C = Cf + Ct Cc + Cb
A = Af
This is not true blending, but at least you have some control external to the
texture alpha (Cc - the texture "environment color"), and Af is written to the
framebuffer alpha, as you want.
I think you can do this through Performer directly too, with pfTEnvMode
and pfTEnvBlendColor.

Bye,
Moshe

--
  Moshe Nissim,   Orad Hi-Tec Systems
  Tel: (972) - 9 - 7676862
  Fax: (972) - 9 - 7676861
  Email: moshe++at++orad.co.il

======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:31 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.