Added phong lighting
This commit is contained in:
parent
839df891ab
commit
6f46112f14
7 changed files with 90 additions and 11 deletions
|
@ -9,11 +9,26 @@
|
|||
#define OBJECT_HPP
|
||||
|
||||
#include <core.hpp>
|
||||
#include <color.hpp>
|
||||
#include <transformable.hpp>
|
||||
#include <vertexArray.hpp>
|
||||
|
||||
namespace oglu
|
||||
{
|
||||
/**
|
||||
* @brief A structure representing an object's material.
|
||||
*/
|
||||
class OGLU_API Material
|
||||
{
|
||||
public:
|
||||
Color ambient = Color::White;
|
||||
Color diffuse = Color::White;
|
||||
Color specular = Color::White;
|
||||
float shininess = 32.0f;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<Material> SharedMaterial;
|
||||
|
||||
/**
|
||||
* @brief An object in 3D space.
|
||||
*
|
||||
|
@ -63,6 +78,10 @@ namespace oglu
|
|||
*/
|
||||
void Render();
|
||||
|
||||
void CopyMaterial(const Material& other);
|
||||
|
||||
SharedMaterial material;
|
||||
|
||||
private:
|
||||
VertexArray VAO; ///< The VAO used for rendering
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue