Add specular lighting
This commit is contained in:
4 files changed
+78
-35
No files matched your search
+2
-1
@@ -1,6 +1,7 @@
|
||||
#ifndef LIGHT_H
|
||||
|
||||
|
||||
#include "camera.h"
|
||||
#include "color.h"
|
||||
#include "geometry.h"
|
||||
#include "point.h"
|
||||
@@ -18,7 +19,7 @@ struct Light
|
||||
|
||||
|
||||
// PUBLIC FUNCTIONS
|
||||
ColorF32 ComputeLight(Vertex &vert, Material &material, Light &light);
|
||||
ColorF32 ComputeLight(Vertex &vert, Material &material, Light &light, Camera &camera);
|
||||
|
||||
|
||||
#define LIGHT_H
|
||||
|
||||
@@ -32,6 +32,18 @@ inline Vector operator-(Vector const &v)
|
||||
return result;
|
||||
}
|
||||
|
||||
// v1 - v2
|
||||
inline Vector operator-(Vector const &v1, Vector const &v2)
|
||||
{
|
||||
Vector result;
|
||||
|
||||
result.x = v1.x - v2.x;
|
||||
result.y = v1.y - v2.y;
|
||||
result.z = v1.z - v2.z;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// v1 + v2
|
||||
inline Vector operator+(Vector const &v1, Vector const &v2)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user