Re: [osg-users] TexEnv and BLEND

2008-11-29 Thread Martin Großer
Hi,

thank you for your answer. Now I have a new question.

How can I set the texture environment color?

Cheers,

Martin

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Ulrich
Hertlein
Gesendet: Samstag, 29. November 2008 07:06
An: OpenSceneGraph Users
Betreff: Re: [osg-users] TexEnv and BLEND

Hi Martin,

On 29/11/08 8:46 AM, Martin Großer wrote:
 I used an object of osg::TexEnv and the mode Blend. But I don't know how
 the texture color and the object color are combined?

 Mode: add -  object color + texture color
   decal -  object color - texture color

That would be subtract; decal modulates color according to texture
alpha.

   modulate -  object color * texture color
   blend -  object color ??? texture color

 Can everybody explain the mode Blend??

The long version (and authoritative) is the Red Book (or man glTexEnv).

The short version (for a RGBA texture) is:
  C = Cfrag * (1-Ctex) + Cconst * Ctex
  A = Afrag * Atex

Basically, for the color channels, the texture color defines the blend
factor between the 
fragment color (e.g. as determined by lighting or vertex color) and
Cconst, the texture 
environment color.  The texture alpha channel modulates the fragment alpha.

Cheers,
/ulrich

PS: Please don't hijack threads.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexEnv and BLEND

2008-11-29 Thread Ulrich Hertlein

Hi Martin,

On 29/11/08 10:32 PM, Martin Großer wrote:

How can I set the texture environment color?


osg::TexEnv::setColor(const osg::Vec4 color);

/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexEnv and BLEND

2008-11-28 Thread Ulrich Hertlein

Hi Martin,

On 29/11/08 8:46 AM, Martin Großer wrote:

I used an object of osg::TexEnv and the mode Blend. But I don't know how
the texture color and the object color are combined?

Mode: add -  object color + texture color
decal -  object color - texture color


That would be subtract; decal modulates color according to texture alpha.


modulate -  object color * texture color
blend -  object color ??? texture color

Can everybody explain the mode Blend??


The long version (and authoritative) is the Red Book (or man glTexEnv).

The short version (for a RGBA texture) is:
 C = Cfrag * (1-Ctex) + Cconst * Ctex
 A = Afrag * Atex

Basically, for the color channels, the texture color defines the blend factor between the 
fragment color (e.g. as determined by lighting or vertex color) and Cconst, the texture 
environment color.  The texture alpha channel modulates the fragment alpha.


Cheers,
/ulrich

PS: Please don't hijack threads.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org