HW T&L: Change unlitcolor initialization and cleanup fragmentshader formatting

This commit is contained in:
BeaR 2013-03-31 12:06:34 +02:00
parent f25735aa93
commit da1b345cd4
2 changed files with 6 additions and 6 deletions

View File

@ -181,15 +181,15 @@ void GenerateFragmentShader(char *buffer) {
} else { // texfmt == RGB
switch (gstate.texfunc & 0x7) {
case GE_TEXFUNC_MODULATE:
WRITE(p, " vec4 v = vec4(t.rgb * p.rgb, p.a)%s;\n", secondary); break;
WRITE(p, " vec4 v = vec4(t.rgb * p.rgb, p.a)%s;\n", secondary); break;
case GE_TEXFUNC_DECAL:
WRITE(p, " vec4 v = vec4(t.rgb, p.a)%s;\n", secondary); break;
WRITE(p, " vec4 v = vec4(t.rgb, p.a)%s;\n", secondary); break;
case GE_TEXFUNC_BLEND:
WRITE(p, " vec4 v = vec4(1.0 - t.rgb) * p.rgb + t.rgb * u_texenv.rgb, p.a)%s;\n", secondary); break;
WRITE(p, " vec4 v = vec4(1.0 - t.rgb) * p.rgb + t.rgb * u_texenv.rgb, p.a)%s;\n", secondary); break;
case GE_TEXFUNC_REPLACE:
WRITE(p, " vec4 v = vec4(t.rgb, p.a)%s;\n", secondary); break;
WRITE(p, " vec4 v = vec4(t.rgb, p.a)%s;\n", secondary); break;
case GE_TEXFUNC_ADD:
WRITE(p, " vec4 v = vec4(t.rgb + p.rgb, p.a)%s;\n", secondary); break;
WRITE(p, " vec4 v = vec4(t.rgb + p.rgb, p.a)%s;\n", secondary); break;
default:
WRITE(p, " vec4 v = p;\n"); break;
}

View File

@ -300,7 +300,7 @@ void GenerateVertexShader(int prim, char *buffer) {
if (hasColor) {
WRITE(p, " lowp vec3 unlitColor = a_color0.rgb;\n");
} else {
WRITE(p, " lowp vec3 unlitColor = vec3(1.0);\n");
WRITE(p, " lowp vec3 unlitColor = u_matambientalpha;\n");
}
// TODO: Declare variables for dots for shade mapping if needed.