I did exactly this in my game, using the third texture unit as a
colormap and using the alpha channel as a mixmap, then a fourth unit
for a detail texture. Obviously, you should check how many texture
units are available and have some sort of fallback. I use colored
vertices when a card has only two units, and I don't use a detail
texture if a card has three. Also, my implementation, apparently,
screws a little with the alpha channel in destination. It's not
visible, but it should be taken into consideration.
/*
We're on a system with at least two texture units. We'll
TEXTURE0 : Primary Texture
TEXTURE1 : Secondary Texture
TEXTURE2 : ColorMap / Mixmap
TEXTURE3 : Detail
The RGB of TEXTURE2 is used for coloration, and the alpha is used
to select blending amount.
*/
Shamyl Zakariya
"this is, after all, one of those movies where people spend a great
deal of time looking at things and pointing."
From a review of _Fantastic Voyage_
On Mar 21, 2005, at 8:18 AM, Kaveh Kardan wrote:
Does anyone have sample code which shows how to blend 2 textures using
a third one as a mask? I have tried various combinations, but none
have worked.
I'm assuming a TiBook has enough texture units (3) to handle this.
I'm using Carbon/GLUT.
Kaveh Kardan Chief Technologist
email@hidden Academy for Creative Media
(808)956-5302 University of Hawaii
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden