#66901 - FireSlash - Sat Jan 14, 2006 6:27 am
Here we go.
#1. Fading a GL texture in and out.
The scene properly waits for a few seconds before unloading, but the alpha NEVER changes from full. Even if I manually set it to, say, 5, it never changes. I made sure that glEnable(GL_BLEND); was set up in the init routine.
#2. Pallete entry 0 not transparent.
I've verified (twice) that pallete entry 0 is indeed the background in these images, but they still show black.
#3 Using...
glOrtho(0,1,0,1,-6,6);
The Depth is based on the Y value, NOT the Z axis. Perhaps I missed something somewhere, but thats how its working for me. I can provide example binaries if needed :p
#4 If anyone has found a way to set up reg_capture without burning two VRAM banks, I'd love to see source for it. Another option would be a way to use banks past D for textures, or for a way to use banks E and F for reg_capture. (For source, see ecurtz's sample: ftp://ftp.nuprometheus.com/pub/Display_Capture.zip )
Important bits:
#5 bitmap fonts in 3d without being able to generate display lists is blowing my mind. I can't seem to find a good way to do it. If anyone can at least point me in the right direction, that'd be awesome.
#6 CF cards are slow. If I load data from them, the DS goes kind of fruity while its being loaded, I assume due to vblank being called with incomplete data drawn. Is there a way to have the DS skip a vblank, or simply use the previous data? It may be simple since REG_CAPTURE is already using two VRAM banks to store the screen data, but I'm having trouble with it.
Thanks for the noob-help :)
_________________
FireSlash.net
#1. Fading a GL texture in and out.
Code: |
bool dsIntro::update()
{ nextScene ns; if((alpha < 62) && (state == state_LOADED) ) alpha++; if((alpha > 0) && (state == state_UNLOADING) ) alpha--; if(alpha >= 62) state = state_UNLOADING; if( (alpha <= 0) && (state = state_UNLOADING) ) { ns = scene_menu; sceneController.changeScene(ns); } return true; } bool dsIntro::draw_bottom(uint32 frame) { byte a; if(alpha == 0) a=0; else a=alpha/2; update(); glPolyFmt(POLY_ALPHA(a) | POLY_CULL_BACK | POLY_FORMAT_LIGHT0); glLoadIdentity(); glTranslatef(0,0,0); glBindTexture(GL_TEXTURE_2D, textures[1]); glBegin(GL_QUADS); glTexCoord2f(1.5f, 0.0f); glVertex3f( 0.0f, 0.0f, 0); glTexCoord2f(1.5f, 2.0f); glVertex3f( 1.0f, 0.0f, 0); glTexCoord2f(0.0f, 2.0f); glVertex3f( 1.0f, 1.0f, 0 ); glTexCoord2f(0.0f, 0.0f); glVertex3f( 0.0f, 1.0f, 0); glEnd(); return TRUE; } |
The scene properly waits for a few seconds before unloading, but the alpha NEVER changes from full. Even if I manually set it to, say, 5, it never changes. I made sure that glEnable(GL_BLEND); was set up in the init routine.
#2. Pallete entry 0 not transparent.
Code: |
pFile = FAT_fopen ("/data/lumiDS/base/sweep.pcx","r");
if (!pFile) return false; FAT_fseek (pFile , 0 , SEEK_END); lSize = FAT_ftell (pFile); FAT_fseek(pFile, 0, SEEK_SET); buffer = (char*) malloc (lSize); if (!buffer) return false; FAT_fread (buffer,1,lSize,pFile); loadPCX((u8*)buffer, &pcx); image8to16(&pcx); glGenTextures(1, &textures[2]); glBindTexture(0, textures[2]); glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_32 , TEXTURE_SIZE_32, 0, GL_TEXTURE_COLOR0_TRANSPARENT | TEXGEN_TEXCOORD, pcx.data8); imageDestroy(&pcx); FAT_fclose (pFile); free (buffer); |
I've verified (twice) that pallete entry 0 is indeed the background in these images, but they still show black.
#3 Using...
glOrtho(0,1,0,1,-6,6);
The Depth is based on the Y value, NOT the Z axis. Perhaps I missed something somewhere, but thats how its working for me. I can provide example binaries if needed :p
#4 If anyone has found a way to set up reg_capture without burning two VRAM banks, I'd love to see source for it. Another option would be a way to use banks past D for textures, or for a way to use banks E and F for reg_capture. (For source, see ecurtz's sample: ftp://ftp.nuprometheus.com/pub/Display_Capture.zip )
Important bits:
Code: |
// ....
if (frameCount & 0x1) { vramSetBankC(VRAM_C_SUB_BG); vramSetBankD(VRAM_D_LCD); SetRegCapture(true, 0, 15, 3, 0, 3, 0, 0); scene->draw_top(frameCount); } else { vramSetBankC(VRAM_C_LCD); vramSetBankD(VRAM_D_SUB_SPRITE); SetRegCapture(true, 0, 15, 2, 0, 3, 0, 0); scene->draw_bottom(frameCount); } // ..... void SetRegCapture(bool enable, uint8 srcBlend, uint8 destBlend, uint8 bank, uint8 offset, uint8 size, uint8 source, uint8 srcOffset) { uint32 value = 0; if (enable) value |= 1 << 31; // 31 is enable value |= 3 << 29; // 29-30 seems to have something to do with the blending value |= (srcOffset & 0x3) << 26; // capture source offset is 26-27 value |= (source & 0x3) << 24; // capture source is 24-25 value |= (size & 0x3) << 20; // capture data write size is 20-21 value |= (offset & 0x3) << 18; // write offset is 18-19 value |= (bank & 0x3) << 16; // vram bank select is 16-17 value |= (srcBlend & 0xF) << 8; // graphics blend evb is 8..12 value |= (destBlend & 0xF) << 0; // ram blend EVA is bits 0..4 REG_CAPTURE = value; } |
#5 bitmap fonts in 3d without being able to generate display lists is blowing my mind. I can't seem to find a good way to do it. If anyone can at least point me in the right direction, that'd be awesome.
#6 CF cards are slow. If I load data from them, the DS goes kind of fruity while its being loaded, I assume due to vblank being called with incomplete data drawn. Is there a way to have the DS skip a vblank, or simply use the previous data? It may be simple since REG_CAPTURE is already using two VRAM banks to store the screen data, but I'm having trouble with it.
Thanks for the noob-help :)
_________________
FireSlash.net