gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > texture bug on 3D

#90476 - delfare - Fri Jun 30, 2006 11:25 am

hi,
I have a texture problem :
I use this texture :
http://delfare.pizz.biz/ALTAsol.bmp

I use TexConv.exe to convert the texture and I get a .bin the .bin is correct when I test in a simple cube

but when I use more textures in more cube, I have a bug :
[Images not permitted - Click here to view it]

the demo is here : http://delfare.pizz.biz/ALTAbug.nds

I use this code to load my texture :
Code:

int load_texture(u8 *data)
{
    int textureID;
    glGenTextures(1, &textureID);
   glBindTexture(0, textureID);
   glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD | GL_TEXTURE_WRAP_S | GL_TEXTURE_WRAP_T, data);
    return textureID;
}


and I use this code to use texture :
Code:
glBindTexture(0, objet_texture[i]);

_________________
If I speak badly, it's because I speak french and I am 15

PA 3d tutorial : http://delfare.pizz.biz

#90519 - Dark Knight ez - Fri Jun 30, 2006 4:24 pm

I don't know if this is your problem, but know this:

You should only load a texture in once. Do not load in the same texture for other cubes... reuse the already loaded in texture by binding it.

I say this because I'm assuming you loaded in too much data in the space you reserved for textures.
If you are already loading in each different texture only once, please try to assign another VRAM banks to textures.

#90529 - delfare - Fri Jun 30, 2006 5:07 pm

no,I load the texture only once in the begin of the program and I use glBindTexture(0, objet_texture[i]); to bind the texture.

to assign another VRAM bank doesn't solve the problem
_________________
If I speak badly, it's because I speak french and I am 15

PA 3d tutorial : http://delfare.pizz.biz

#90920 - silent_code - Mon Jul 03, 2006 2:12 pm

looks like some alignment or palette problem... i really don't know. are you using 8bit textures? this looks like you have an individual palette for every texture instead of a common one and use the palette of the texture that looks fine. i'm not experienced in nds textures, though.

good luck!