Skip to content

Commit

Permalink
Merge pull request #5612 from raven02/patch-27
Browse files Browse the repository at this point in the history
Shade mapping fix
  • Loading branch information
hrydgard committed Mar 22, 2014
2 parents cbc46be + 1b831ce commit 98da514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GPU/GLES/SoftwareTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
Vec3f lightpos1 = Vec3f(gstate_c.lightpos[gstate.getUVLS1()]).Normalized();

uv[0] = (1.0f + Dot(lightpos0, normal))/2.0f;
uv[1] = (1.0f - Dot(lightpos1, normal))/2.0f;
uv[1] = (1.0f + Dot(lightpos1, normal))/2.0f;
uv[2] = 1.0f;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/VertexShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void GenerateVertexShader(int prim, u32 vertType, char *buffer, bool useHWTransf
break;

case GE_TEXMAP_ENVIRONMENT_MAP: // Shade mapping - use dots from light sources.
WRITE(p, " v_texcoord = u_uvscaleoffset.xy * vec2(1.0 + dot(normalize(u_lightpos%i), worldnormal), 1.0 - dot(normalize(u_lightpos%i), worldnormal)) * 0.5;\n", gstate.getUVLS0(), gstate.getUVLS1());
WRITE(p, " v_texcoord = u_uvscaleoffset.xy * vec2(1.0 + dot(normalize(u_lightpos%i), worldnormal), 1.0 + dot(normalize(u_lightpos%i), worldnormal)) * 0.5;\n", gstate.getUVLS0(), gstate.getUVLS1());
break;

default:
Expand Down

0 comments on commit 98da514

Please sign in to comment.