I have a really hard time getting my alpha blending to work. Basically I've taken the setup from how it is done in the sprite sample, which works fine.
The code is shown below (it taken from several places in the project, but the code below shows the order and parameters to the GU calls). It has been stripped down to a minimum, to only two vertices for a single sprite, but it still doesn't work.
Some info. My textures are correct and I've also tried to use the ball.raw from the sprite sample Also, if I don't call sceGuEnable(GU_ALPHA_TEST), the sprite shows up correct. I have other renderings in the projects, where the alpha channel seems to be used just fine ?
Can anyone seem to difference, from what I'm doing here to what is done in the sprite sample ??
Code: Select all
sceGuAlphaFunc(GU_GREATER,0,0xff);
sceGuEnable(GU_ALPHA_TEST);
sceGuEnable(GU_TEXTURE_2D);
// setup texture
sceGuTexMode(GU_PSM_5551,0,0,0);
sceGuTexImage(0,width, height, width, (void *)offset);
sceGuTexFunc(GU_TFX_MODULATE,GU_TCC_RGBA);
sceGuDepthFunc(GU_ALWAYS);
sceGuAmbientColor(0xffffffff);
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
{
ScePspFVector3 pos = { 0, 0, -4.5f };
sceGumRotateXYZ(&rot);
}
jsaParticleVertex* l_vertices = (jsaParticleVertex*)sceGuGetMemory(2 * sizeof(jsaParticleVertex));
jsaParticleVertex *index = &l_vertices[0];
index[0].u = 0;
index[0].v = 0;
index[0].color = 0xffffffff;
index[0].x = - 1.0f;
index[0].y = - 1.0f;
index[0].z = 0;
index[1].u = 1;
index[1].v = 1;
index[1].color = 0xffffffff;
index[1].x = 1.0f;
index[1].y = 1.0f;
index[1].z = 0;
sceGumDrawArray(GU_SPRITES, GU_COLOR_8888 | GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_3D,2,0,l_vertices);
sceGuDepthFunc(GU_GEQUAL);
sceGuDisable(GU_ALPHA_TEST);
sceGuDisable(GU_TEXTURE_2D);