am 0b70c09c: am 7ae6fc81: Merge "A better looking and faster spot shadow." into lmp-mr1-dev

* commit '0b70c09c1df3a5c359b8a93a8ac08e945805b693':
  A better looking and faster spot shadow.
This commit is contained in:
ztenghui
2014-11-07 00:17:09 +00:00
committed by Android Git Automerger
4 changed files with 317 additions and 665 deletions

View File

@ -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++) {

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -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);
}