Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 278b3016 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 2a60824a: am 516efc1b: am 8a2b5423: Merge "libagl: Transform the vertex if...

am 2a60824a: am 516efc1b: am 8a2b5423: Merge "libagl: Transform the vertex if using eye space lighting with point lights"

* commit '2a60824a':
  libagl: Transform the vertex if using eye space lighting with point lights
parents 12ba3127 2a60824a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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 {