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

Commit 7ae6fc81 authored by ztenghui's avatar ztenghui Committed by Android (Google) Code Review
Browse files

Merge "A better looking and faster spot shadow." into lmp-mr1-dev

parents 50ef3d93 d2dcd6fd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -326,9 +326,9 @@ void AmbientShadow::createAmbientShadow(bool isCasterOpaque,
    shadowVertexBuffer.updateVertexCount(vertexBufferIndex);
    shadowVertexBuffer.updateIndexCount(indexBufferIndex);

    ShadowTessellator::checkOverflow(vertexBufferIndex, totalVertexCount, "Vertex Buffer");
    ShadowTessellator::checkOverflow(indexBufferIndex, totalIndexCount, "Index Buffer");
    ShadowTessellator::checkOverflow(umbraIndex, totalUmbraCount, "Umbra Buffer");
    ShadowTessellator::checkOverflow(vertexBufferIndex, totalVertexCount, "Ambient Vertex Buffer");
    ShadowTessellator::checkOverflow(indexBufferIndex, totalIndexCount, "Ambient Index Buffer");
    ShadowTessellator::checkOverflow(umbraIndex, totalUmbraCount, "Ambient Umbra Buffer");

#if DEBUG_SHADOW
    for (int i = 0; i < vertexBufferIndex; i++) {
+296 −614

File changed.

Preview size limit exceeded, changes collapsed.

+0 −34
Original line number Diff line number Diff line
@@ -36,40 +36,6 @@ private:
    static float projectCasterToOutline(Vector2& outline,
            const Vector3& lightCenter, const Vector3& polyVertex);

    static int setupAngleList(VertexAngleData* angleDataList,
            int polyLength, const Vector2* polygon, const Vector2& centroid,
            bool isPenumbra, const char* name);

    static int convertPolysToVerticesPerRay(
            bool hasOccludedUmbraArea, const Vector2* poly2d, int polyLength,
            const Vector2* umbra, int umbraLength, const Vector2* penumbra,
            int penumbraLength, const Vector2& centroid,
            Vector2* umbraVerticesPerRay, Vector2* penumbraVerticesPerRay,
            Vector2* occludedUmbraVerticesPerRay);

    static bool checkClockwise(int maxIndex, int listLength,
            VertexAngleData* angleList, const char* name);

    static void calculateDistanceCounter(bool needsOffsetToUmbra, int angleLength,
            const VertexAngleData* allVerticesAngleData, int* distances);

    static void mergeAngleList(int maxUmbraAngleIndex, int maxPenumbraAngleIndex,
            const VertexAngleData* umbraAngleList, int umbraLength,
            const VertexAngleData* penumbraAngleList, int penumbraLength,
            VertexAngleData* allVerticesAngleData);

    static int setupPolyAngleList(float* polyAngleList, int polyAngleLength,
        const Vector2* poly2d, const Vector2& centroid);

    static bool checkPolyClockwise(int polyAngleLength, int maxPolyAngleIndex,
        const float* polyAngleList);

    static int getEdgeStartIndex(const int* offsets, int rayIndex, int totalRayNumber,
        const VertexAngleData* allVerticesAngleData);

    static int getPolyEdgeStartIndex(int maxPolyAngleIndex, int polyLength,
        const float* polyAngleList, float rayAngle);

    static void computeLightPolygon(int points, const Vector3& lightCenter,
            float size, Vector3* ret);

+4 −0
Original line number Diff line number Diff line
@@ -99,6 +99,10 @@ struct Vector2 {
        return x * v.x + y * v.y;
    }

    float cross(const Vector2& v) const {
        return x * v.y - y * v.x;
    }

    void dump() {
        ALOGD("Vector2[%.2f, %.2f]", x, y);
    }