Welcome! Log In Create A New Profile

Advanced

multiple gx textures?

Posted by mavakadachi 
multiple gx textures?
January 19, 2009 10:53PM
hey guys can you tell me how to create and use more then 1 texture? its been said that the wii only supports 8? when i searched GX_SetNumTexGens in devkitpro example i only found GX_SetNumTexGens(0) and GX_SetNumTexGens(1) (i used msvc so i can see the line w/o opening the file)

So can someone point me to an example or tell me what functions i need to use to set and switch between multiple textures?
Re: multiple gx textures?
January 20, 2009 10:18AM
you are limited to 8 texture object and 8 texture coordinates system in GX memory, that's right
a texture object hold a pointer to texture data, texture type, texture size, etc
texture coordinates are similar to the openGL concept, this defines how to draw the texture on your scene

when you load a texture object (GX_LoadTexObj), you specify an index (from GX_TEXMAP0 to GX_TEXMAP7)

also, you need to configure the TEV stages to do multitexturing, using GX_SetTevOrder function which also tell what texture mapping and texture coordinate (from GX_TEXCOORD0 to GX_TEXCOORD7) you are using... I don't really know how to use that function and all the TEV stages though, and I don't know many people using more than the first TEV stage (the HBC uses it I think)

I think that GX_SetNumTexGens set the number of texture coordinate systems you are using (max is 8 also)


I'm not sure what you are looking for but you could also ONLY use GX_TEXCOORD0 and GX_TEXMAP0 and simply reinitialize a new texture object everytime you need a new texture (GX_InitTexObj initialize a texture object and associate it to a specific texture data in main memory)

technically, you are not "really" limited to 8 textures since textures are stored in external memory but it's less efficient that way I bet



Edited 2 time(s). Last edit at 01/20/2009 10:46AM by ekeeke.
Re: multiple gx textures?
January 20, 2009 11:11AM
lies!

you're limited to 8 texture maps, but can have many textures in each. HBC uses one map for all its textures. because we sort of fail at 3d APIs every letter you see on screen is its own GXTexObj, so no, we're way beyond 8 :P
Re: multiple gx textures?
January 20, 2009 11:34AM
lol, I beg your pardon, I will never lie again, I promise :-)

more seriously, this is what I wanted to say, except that I misfigured the word "texture object" in the first sentence: you are limited to load 8 distinct texture objects at the same time in GX memory since there is room for 8 texture map.. is that more correct ?



about the HBC, i thought you were using all the complexity of the 8 TEV stages ?



Edited 2 time(s). Last edit at 01/20/2009 11:37AM by ekeeke.
Re: multiple gx textures?
January 20, 2009 11:40AM
heh, don't take me serioulsy, just messing ;)

HBC just uses GX_TEVSTAGE0 with some alpha blending. the GX code is in no way complex. but that YUV TEV voodoo sepp256 did for mplayer sort of is :)
Re: multiple gx textures?
January 21, 2009 02:54AM
So you have 8 texture maps and you can have as many texture objects as you like.
How big is the texture map? can my texture object be a non power of 2? so i can have 8 objects on the same texture or 1 on each and anything in between?

What do i use texture obj for? and can someone show me an example of using all 8 maps and drawing a piece from map 0 and map 7. I can figure out the rest from there :D
/end post full of question and little context
Sorry, only registered users may post in this forum.

Click here to login