summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorMathias Agopian <pixelflinger@gmail.com>2012-09-19 19:31:52 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-09-19 19:31:53 -0700
commit8a2b54235a45f92827b13723380065d1ce308236 (patch)
tree92366a36f7b16903e2455ca471a1ecec22f245c6 /opengl
parent09a22fc29d588b173e5c0dd2002ac2c44d45b7c6 (diff)
parentd5b1cda91ea5826e0fe8fa20d7daad57dc9ffd8b (diff)
downloadframeworks_native-8a2b54235a45f92827b13723380065d1ce308236.zip
frameworks_native-8a2b54235a45f92827b13723380065d1ce308236.tar.gz
frameworks_native-8a2b54235a45f92827b13723380065d1ce308236.tar.bz2
Merge "libagl: Transform the vertex if using eye space lighting with point lights"
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libagl/light.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/opengl/libagl/light.cpp b/opengl/libagl/light.cpp
index ca715db..fafec3f 100644
--- a/opengl/libagl/light.cpp
+++ b/opengl/libagl/light.cpp
@@ -381,7 +381,14 @@ void lightVertex(ogles_context_t* c, vertex_t* v)
// compute vertex-to-light vector
if (ggl_unlikely(l.position.w)) {
// lightPos/1.0 - vertex/vertex.w == lightPos*vertex.w - vertex
+#if !OBJECT_SPACE_LIGHTING
+ vec4_t o;
+ const transform_t& mv = c->transforms.modelview.transform;
+ mv.point4(&mv, &o, &v->obj);
+ vss3(d.v, l.objPosition.v, o.w, o.v);
+#else
vss3(d.v, l.objPosition.v, v->obj.w, v->obj.v);
+#endif
sqDist = dot3(d.v, d.v);
vscale3(d.v, d.v, gglSqrtRecipx(sqDist));
} else {