Smooth triangles! And support for them in the OBJ File parser.

Also add an interesting tea party scene!
This commit is contained in:
Godzil
2020-03-06 15:07:26 +00:00
parent 73012b6dd1
commit e57b5715e8
38 changed files with 705 additions and 75 deletions

View File

@@ -14,15 +14,16 @@
class RenderStats
{
private:
uint64_t coneCount; /* Total number of cones */
uint64_t cylinderCount; /* Total number of cylinder */
uint64_t cubeCount; /* Total number of cubes */
uint64_t groupCount; /* Total number of groups */
uint64_t lightCount; /* Total number of light */
uint64_t planeCount; /* Total number of plane */
uint64_t sphereCount; /* Total number of sphere */
uint64_t triangleCount; /* Total number of triangle */
uint64_t objfileCount; /* Total number of OBJ File */
uint64_t coneCount; /* Total number of cones */
uint64_t cylinderCount; /* Total number of cylinder */
uint64_t cubeCount; /* Total number of cubes */
uint64_t groupCount; /* Total number of groups */
uint64_t lightCount; /* Total number of light */
uint64_t planeCount; /* Total number of plane */
uint64_t sphereCount; /* Total number of sphere */
uint64_t triangleCount; /* Total number of triangle */
uint64_t smoothTriangleCount; /* Total number of smooth triangle */
uint64_t objfileCount; /* Total number of OBJ File */
uint64_t pixelCount; /* Total number of rendered pixels */
uint64_t rayCount; /* Total number of rays */
@@ -40,7 +41,7 @@ private:
public:
RenderStats() : coneCount(0), cylinderCount(0), cubeCount(0), groupCount(0), lightCount(0), planeCount(0), sphereCount(0), triangleCount(0),
pixelCount(0), rayCount(0), lightRayEmitedCount(0), reflectionRayCount(0), refractedRayCount(0),
intersectCount(0), intersectionCount(0), reallocCallCount(0), mallocCallCount(0),
intersectCount(0), intersectionCount(0), reallocCallCount(0), mallocCallCount(0), smoothTriangleCount(0),
discardedIntersectCount(0), maxDepthAttained(UINT64_MAX), maxIntersectOnARay(0), objfileCount(0) {};
#ifdef RENDER_STATS
void addCone();
@@ -52,6 +53,7 @@ public:
void addSphere();
void addOBJFile();
void addTriangle();
void addSmoothTriangle();
void printStats();
void addPixel();
void addRay();
@@ -74,6 +76,7 @@ public:
static void addPlane() {};
static void addSphere() {};
static void addTriangle() {};
static void addSmoothTriangle() {};
static void printStats() {};
static void addPixel() {};
static void addRay() {};