mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 18:30:56 +00:00
Merge branch 'shader' of https://github.com/cinaera/ppsspp into cinaera-shader
This commit is contained in:
commit
382e1df04c
@ -341,7 +341,7 @@ void Lighter::Light(float colorOut0[4], float colorOut1[4], const float colorIn[
|
||||
if (dot > 0.0f)
|
||||
{
|
||||
Color4 lightSpec(gstate_c.lightColor[2][l], 0.0f);
|
||||
lightSum1 += (lightSpec * *specular * (powf(dot, specCoef_) * (dot * lightScale)));
|
||||
lightSum1 += (lightSpec * *specular * (powf(dot, specCoef_) * lightScale));
|
||||
}
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
||||
} else {
|
||||
// Summed color into c0
|
||||
for (int j = 0; j < 4; j++) {
|
||||
c0[j] = c0[j] + litColor1[j];
|
||||
c0[j] = ((c0[j] + litColor1[j]) > 1.0f) ? 1.0f : (c0[j] + litColor1[j]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -301,7 +301,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(u_matambientalpha);\n");
|
||||
WRITE(p, " lowp vec3 unlitColor = u_matambientalpha.rgb;\n");
|
||||
}
|
||||
// TODO: Declare variables for dots for shade mapping if needed.
|
||||
|
||||
@ -364,7 +364,7 @@ void GenerateVertexShader(int prim, char *buffer) {
|
||||
WRITE(p, " vec3 halfVec%i = normalize(normalize(toLight%i) + vec3(0.0, 0.0, 1.0));\n", i, i);
|
||||
WRITE(p, " dot%i = dot(halfVec%i, worldnormal);\n", i, i);
|
||||
WRITE(p, " if (dot%i > 0.0)\n", i);
|
||||
WRITE(p, " lightSum1 += u_lightspecular%i * %s * (pow(dot%i, u_matspecular.a) * (dot%i * lightScale%i));\n", i, specular, i, i, i);
|
||||
WRITE(p, " lightSum1 += u_lightspecular%i * %s * (pow(dot%i, u_matspecular.a) * lightScale%i);\n", i, specular, i, i);
|
||||
}
|
||||
WRITE(p, " lightSum0 += vec4((u_lightambient%i + diffuse%i)*lightScale%i, 0.0);\n", i, i, i);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ struct GPUgstate
|
||||
offsetx,
|
||||
offsety,
|
||||
pad111[2],
|
||||
lmode,
|
||||
shademodel,
|
||||
reversenormals,
|
||||
pad222,
|
||||
materialupdate,
|
||||
@ -114,7 +114,7 @@ struct GPUgstate
|
||||
materialspecularcoef,
|
||||
ambientcolor,
|
||||
ambientalpha,
|
||||
colormodel,
|
||||
lmode,
|
||||
ltype[4],
|
||||
lpos[12],
|
||||
ldir[12],
|
||||
|
Loading…
Reference in New Issue
Block a user