patch TinyRenderer so it software-renders in an OpenGL texture, for testing

fix texture support: flip texture to make OpenGL happy (lower-left is origin)
add path prefix to .obj loader, so materials/textures are loaded ok.
This commit is contained in:
erwin coumans
2016-04-26 20:52:52 -07:00
parent 2cb39e358a
commit 03bdcc8737
16 changed files with 496 additions and 195 deletions

View File

@@ -3,12 +3,12 @@
#include "tgaimage.h"
#include "geometry.h"
extern Matrix ModelView;
extern Matrix Projection;
void viewport(int x, int y, int w, int h);
void projection(float coeff=0.f); // coeff = -1/c
void lookat(Vec3f eye, Vec3f center, Vec3f up);
Matrix viewport(int x, int y, int w, int h);
Matrix projection(float coeff=0.f); // coeff = -1/c
Matrix lookat(Vec3f eye, Vec3f center, Vec3f up);
struct IShader {
virtual ~IShader();
@@ -17,6 +17,6 @@ struct IShader {
};
//void triangle(Vec4f *pts, IShader &shader, TGAImage &image, float *zbuffer);
void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer);
void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix);
#endif //__OUR_GL_H__