diff options
author | Mathias Agopian <pixelflinger@gmail.com> | 2012-09-19 22:05:14 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-19 22:05:14 -0700 |
commit | 2a60824abcbfc2c5b936d3711d6d32318c489e88 (patch) | |
tree | a3e1a1872008f6f9b6c79d3563bfa35f4e9ae59d /opengl/libagl | |
parent | 3a24e8f160c7794f44ef9fd5c70a61ff62412717 (diff) | |
parent | 516efc1bea1c05492c5d4636a589cfc686661842 (diff) | |
download | frameworks_native-2a60824abcbfc2c5b936d3711d6d32318c489e88.zip frameworks_native-2a60824abcbfc2c5b936d3711d6d32318c489e88.tar.gz frameworks_native-2a60824abcbfc2c5b936d3711d6d32318c489e88.tar.bz2 |
am 516efc1b: am 8a2b5423: Merge "libagl: Transform the vertex if using eye space lighting with point lights"
* commit '516efc1bea1c05492c5d4636a589cfc686661842':
libagl: Transform the vertex if using eye space lighting with point lights
Diffstat (limited to 'opengl/libagl')
-rw-r--r-- | opengl/libagl/light.cpp | 7 |
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 { |