Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: combine two textures ?  (Read 246 times)
Gamecode
Customers
Community Member
*****
Posts: 367


WWW
« on: September 05, 2008, 12:35:23 AM »

hi
i need combine one clasics texture and one alphamap into one tex.and this texture then draw with screen2d.drawtexture.

see screen.

Logged

aiR Captains - RC aircraft project TV65
ZaPPZion
Community Member
*
Posts: 341


« Reply #1 on: September 05, 2008, 02:52:51 AM »

Code:
int source = TF.LoadTexture("\\media\\texture.jpg");
int alpha = TF.LoadAlphaTexture("\\media\\alpha.jpg");
int combined = TF.AddAlphaChannel(source, alpha, "combined");
that's C#, but i'm sure you can change that Wink
Logged
Gamecode
Customers
Community Member
*****
Posts: 367


WWW
« Reply #2 on: September 05, 2008, 05:05:44 AM »

Code:
int source = TF.LoadTexture("\\media\\texture.jpg");
int alpha = TF.LoadAlphaTexture("\\media\\alpha.jpg");
int combined = TF.AddAlphaChannel(source, alpha, "combined");
that's C#, but i'm sure you can change that Wink

great thanxs.
and if i need rotate with alphamap ? must on every frame create new "combined" texture ?
Logged

aiR Captains - RC aircraft project TV65
ZaPPZion
Community Member
*
Posts: 341


« Reply #3 on: September 05, 2008, 05:18:37 AM »

no, the combined one is just a normal texture with an alpha channel, so you can rotate that texture just like you would rotate any other texture. I don't know if it's the same if you just want to rotate the alpha channel, that's different i guess.
Logged
Gamecode
Customers
Community Member
*****
Posts: 367


WWW
« Reply #4 on: September 05, 2008, 10:34:43 AM »

no, the combined one is just a normal texture with an alpha channel, so you can rotate that texture just like you would rotate any other texture. I don't know if it's the same if you just want to rotate the alpha channel, that's different i guess.

no i need base texture in same position (0 degrees) and rotate only with alpha chanel
Logged

aiR Captains - RC aircraft project TV65
jviper
Community Member
*
Posts: 1365

Discipline in training


« Reply #5 on: September 05, 2008, 11:44:42 AM »

I wonder: can in the AddAlphaChannel funcion, can you pass a rendersurface texture to the alpha argument? If so, then you couls render your rotated alpha texture to the rendersurface. Don't know if this is legal though.
Logged

JAbstract.....Don't just imagine, make it happen!
newborn
Customers
Community Member
*****
Posts: 2437


WWW
« Reply #6 on: September 06, 2008, 08:33:09 AM »

This is awesome! thanks a bunch!

and yes, you can pass a rendersurface as a texture:

Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks