blending texture with textureinfo

Started by nmare, January 21, 2013, 02:52:49 AM

Previous topic - Next topic

nmare

hi!

i actually try to transform a texture when an object have a special status.   In this case, a frozen card.   So i have a normal texture for each cards and a icy texture of the same size
using the same uv mapping format.    My objects have their own UV Mapping (Using 3ds), in fact all cards use the same cloned object.

So i want to blend both textures

here the code i use


TextureInfo ti = new TextureInfo( TextureManager.getInstance().getTextureID("card" + Integer.toString( CardId+1 )) );
ti.add(TextureManager.getInstance().getTextureID("frozencard"), TextureInfo.MODE_BLEND );
game.card[CardId].setTexture(ti);


If i use only one texture. It work fine.  I can see the card texture or the frozencard texture.   when i try to blend both im getting this error on the setTexture line:

01-20 20:26:20.187: I/jPCT-AE(26561): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
01-20 20:26:20.187: I/jPCT-AE(26561):    at com.threed.jpct.Object3D.setTexture(Object3D.java:3411)
01-20 20:26:20.187: I/jPCT-AE(26561):    at com.nmare.puzzker.anims.Freeze.FreezeCard(Freeze.java:37)

ti.MAX_PHYSICAL_TEXTURE_STAGES give me 4.

Im out of idea.  Whats wrong? 

Thx for the help
DevGeek studio
Indie Developer (android, opengl, databases)

EgonOlsen

Please try the latest beta version: http://jpct.de/download/beta/jpct-ae.jar. I don't think that this will help, but just to be sure...

If it still doesn't work, please post the exception that this beta version throws.

I think this happens because you are trying to add additional layers after the object has been compiled (and maybe stripped). This isn't supposed to work anyway, because it would require a recompile of the object. Have you tried to add that second layer right after loading the object and initialize it using some transparent texture?




nmare

Hi

QuoteI think this happens because you are trying to add additional layers after the object has been compiled (and maybe stripped). This isn't supposed to work anyway, because it would require a recompile of the object. Have you tried to add that second layer right after loading the object and initialize it using some transparent texture?

woops...    objects are already compiled and stripped when i change the texture.   I had not seen it in the forum... or maybe im blind  ;D

Ok, so i have to destroy my object and then rebuild it with a new skin each time?  Ill give a try.   


QuotePlease try the latest beta version: http://jpct.de/download/beta/jpct-ae.jar. I don't think that this will help, but just to be sure...

My game will be ready for the market in the next month, so i dont want to use a beta version if possible.   


thx for your fast answer like usual  :)
DevGeek studio
Indie Developer (android, opengl, databases)

nmare

Ahahahaha it work now...

But the card look burned instead of frosted...    Will have to work on the blending and the frost texture.      And now i have a Burned card status  ;D
DevGeek studio
Indie Developer (android, opengl, databases)