Hi Josef,

Josef Grunig wrote:
> Hi all,
> 
> I've a cubeTextureChunk defined as:
> 
> beginEditCP(cubetex);
>               cubetex->setImage( inegz );
>               cubetex->setPosZImage( iposz );
>               cubetex->setPosYImage( iposy );
>               cubetex->setNegYImage( inegy );
>               cubetex->setPosXImage( iposx );
>               cubetex->setNegXImage( inegx );
>               cubetex->setMinFilter( GL_LINEAR );
>               cubetex->setMagFilter( GL_NEAREST );
>               cubetex->setWrapS( GL_CLAMP_TO_EDGE );
>               cubetex->setWrapT( GL_CLAMP_TO_EDGE );
>               cubetex->setEnvMode( GL_DECAL );
> endEditCP(cubetex);
> 
> images are RGBA with ALPHA = 1;
> 
> I would like to blend colors using the OpenGL Decal texture Function
> (C=Cf(1-At)+CtAt where C=RGB color, A = alpha, t = texture, f =
> fragment), but instead of using the texture's alpha I would like to
> use a custom value. A computational heavy solutions is to modify the
> whole image's alpha channel. Is there a better way for doing this?

These days the default answer to a question like is 'shader'. ;) That would 
probably be the most efficient way of doing this kind of pixel math. The 
problem 
with shaders is having to handle all cases, which can make them a little 
unwieldy.

If you don't want to or can't use shaders, the COMBINE texture environment can 
probably do the same thing, by allowing you to feed constants into the blending 
equation. I haven't used that in a long time, so I don't have an immediate 
recipe on how to do it, but it should be possible.

Hope it helps

        Dirk

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to