aboutsummaryrefslogtreecommitdiff
path: root/graphics.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-02-25 20:14:30 +0000
committerrodri <rgl@antares-labs.eu>2024-02-25 20:14:30 +0000
commitc0bc9d332f3ab51a43d5e3d0da2d5a32e938b1d2 (patch)
treec85ea648de382df22d3fa7eb046b048671af249c /graphics.h
parent22e341ed6fc92f7bd547b0e6b1d5501d3eb9a7db (diff)
downloadlibgraphics-c0bc9d332f3ab51a43d5e3d0da2d5a32e938b1d2.tar.gz
libgraphics-c0bc9d332f3ab51a43d5e3d0da2d5a32e938b1d2.tar.bz2
libgraphics-c0bc9d332f3ab51a43d5e3d0da2d5a32e938b1d2.zip
interpolate every vertex attribute when clipping and during rasterization.
added parameters necessary to implement the Phong shading model.
Diffstat (limited to 'graphics.h')
-rw-r--r--graphics.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/graphics.h b/graphics.h
index 930eca1..e98ae9a 100644
--- a/graphics.h
+++ b/graphics.h
@@ -40,6 +40,7 @@ struct Vertex
Point2 uv; /* texture coordinate */
double intensity;
+ Point3 pos;
};
typedef Vertex Triangle[3];
@@ -47,6 +48,7 @@ typedef Vertex Triangle[3];
struct LightSource
{
Point3 p;
+ Color c;
int type;
};
@@ -55,12 +57,14 @@ struct Material
Color ambient;
Color diffuse;
Color specular;
+ double shininess;
};
struct Model
{
OBJ *obj;
- Memimage *tex;
+ Memimage *tex; /* texture map */
+ Memimage *nor; /* normals map */
Material *materials;
ulong nmaterials;
@@ -112,7 +116,9 @@ struct SUparams
/* TODO replace with a Scene */
Entity *entity;
- double var_intensity[3];
+ double var_intensity;
+ Point3 var_normal;
+ Point3 var_pos;
uvlong uni_time;