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:
@@ -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__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user