Merge pull request #391 from raven02/master

Fix alpha blending for HW & SW transform
This commit is contained in:
Henrik Rydgård 2013-01-10 07:26:57 -08:00
commit c484c5ebb4
2 changed files with 7 additions and 7 deletions

View file

@ -384,9 +384,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
c1[j] = 0.0f;
}
} else {
c0[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[0] = (gstate.materialambient & 0xFF) / 255.f;
c0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[2] = (gstate.materialambient & 0xFF) / 255.f;
c0[2] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[3] = (gstate.materialalpha & 0xFF) / 255.f;
}
@ -443,9 +443,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
if (reader.hasColor0()) {
reader.ReadColor0(unlitColor);
} else {
unlitColor[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
unlitColor[0] = (gstate.materialambient & 0xFF) / 255.f;
unlitColor[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
unlitColor[2] = (gstate.materialambient & 0xFF) / 255.f;
unlitColor[2] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
unlitColor[3] = (gstate.materialalpha & 0xFF) / 255.f;
}
float litColor0[4];
@ -474,8 +474,8 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
c1[j] = 0.0f;
}
} else {
c0[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[0] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[1] = (gstate.materialambient & 0xFF) / 255.f;
c0[2] = (gstate.materialambient & 0xFF) / 255.f;
c0[3] = (gstate.materialalpha & 0xFF) / 255.f;
}

View file

@ -338,7 +338,7 @@ void GenerateVertexShader(int prim, char *buffer) {
if (hasColor) {
WRITE(p, " v_color0 = a_color0;\n");
} else {
WRITE(p, " v_color0 = u_matambientalpha;\n");
WRITE(p, " v_color0 += vec4(u_matambientalpha.rgb, 0.0);\n");
}
if (lmode)
WRITE(p, " v_color1 = vec3(0.0, 0.0, 0.0);\n");