Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
A struct, used as a component, describing the emissive properties of the light it represents per the Blinn-Phong shading model. More...
#include <light.hpp>
Public Types | |
enum | LightType : int { directional =0 , point =1 , spot =2 } |
Integers representing different types of light sources. | |
Static Public Member Functions | |
static LightEmissionData | MakeDirectionalLight (const glm::vec3 &diffuse, const glm::vec3 &specular, const glm::vec3 &ambient) |
Creates a directional source of light, which (in a scene) faces one direction and experiences no attenuation. | |
static LightEmissionData | MakePointLight (const glm::vec3 &diffuse, const glm::vec3 &specular, const glm::vec3 &ambient, float linearConst, float quadraticConst) |
Creates a point source of light which has a position and experiences attenuation, but has no direction. | |
static LightEmissionData | MakeSpotLight (float innerAngle, float outerAngle, const glm::vec3 &diffuse, const glm::vec3 &specular, const glm::vec3 &ambient, float linearConst, float quadraticConst) |
Creates a spotlight which has a position, experiences attenuation, and has a direction. | |
static float | CalculateRadius (const glm::vec4 &diffuseColor, float decayLinear, float decayQuadratic, float intensityCutoff) |
A function that computes the cutoff radius for a light source based on its emissive properties. | |
static std::string | getComponentTypeName () |
The component type string associated with this object. | |
Public Attributes | |
LightType | mType |
The type of light described by this object. | |
glm::vec4 | mDiffuseColor |
The color of the diffuse component of the light represented by this object. | |
glm::vec4 | mSpecularColor |
The color of the specular component of the light represented by this object. | |
glm::vec4 | mAmbientColor |
The color of the ambient component of the light represented by this object. | |
GLfloat | mDecayLinear |
A linear factor governing the attenuation in light intensity with distance from source, per the Blinn-Phong model. | |
GLfloat | mDecayQuadratic |
A quadractic factor governing the attenuation in light intensity with distance from source, per the Blinn-Phong model. | |
GLfloat | mCosCutoffInner |
The cos of the angle between the surface of the inner cone of a spot light (within which light intensity is highest), and the direction vector of the light. | |
GLfloat | mCosCutoffOuter |
The cos of the angle between the surface of the outer cone of a spot light (beyond which light intensity drops to 0), and the direction vector of the light. | |
GLfloat | mRadius {0.f} |
The computed radius of the light beyond which the light is no longer active, based on its emission data. | |
A struct, used as a component, describing the emissive properties of the light it represents per the Blinn-Phong shading model.
Its appearance in json might be as follows:
|
static |
A function that computes the cutoff radius for a light source based on its emissive properties.
diffuseColor | The diffuse color of the light. |
decayLinear | The linear factor governing light intensity decay. |
decayQuadratic | The quadratic factor governing light intensity decay. |
intensityCutoff | The nth fraction of the max intensity of the light beyond which the light is considered inactive. Eg., intensityCutoff = 40.f => intensityAtRadius = maxIntensity/40.f. |
|
inlinestatic |
The component type string associated with this object.
|
static |
Creates a directional source of light, which (in a scene) faces one direction and experiences no attenuation.
diffuse | The diffuse component of a light per the Blinn-Phong model. |
specular | The specular component of a light per the Blinn-Phong model. |
ambient | The ambient component of a light per the Blinn-Phong model. |
|
static |
Creates a point source of light which has a position and experiences attenuation, but has no direction.
diffuse | The diffuse component of the light per the Blinn-Phong model. |
specular | The specular component of the light per the Blinn-Phong model. |
ambient | The ambient component of the light per the Blinn-Phong model. |
linearConst | The factor governing linear reduction in intensity of light with distance. |
quadraticConst | The factor governing quadratic reduction in intensity of light with distance. |
|
static |
Creates a spotlight which has a position, experiences attenuation, and has a direction.
diffuse | The diffuse component of the light per the Blinn-Phong model. |
specular | The specular component of the light per the Blinn-Phong model. |
ambient | The ambient component of the light per the Blinn-Phong model. |
linearConst | The factor governing linear reduction in intensity of light with distance. |
quadraticConst | The factor governing quadratic reduction in intensity of light with distance. |
innerAngle | The angle, in degrees, made by the inner cone of the spotlight (where intensity is strongest) relative to the direction vector of the light. |
outerAngle | The angle, in degrees, made by the outer cone of the spotlight (beyond which no light is present) relative to the direction vector of the light. |
glm::vec4 ToyMaker::LightEmissionData::mAmbientColor |
The color of the ambient component of the light represented by this object.
Represents this source's contribution to indirect lighting affecting an object, reflected from other objects in the scene. This factor just approximates indirect ambient light, and doesn't model real ambient lighting.
glm::vec4 ToyMaker::LightEmissionData::mDiffuseColor |
The color of the diffuse component of the light represented by this object.
The diffuse color is what we would think of as "the color" of an object. In light, it is the color of the light affecting object surfaces pointing towards the light source.
GLfloat ToyMaker::LightEmissionData::mRadius {0.f} |
The computed radius of the light beyond which the light is no longer active, based on its emission data.
glm::vec4 ToyMaker::LightEmissionData::mSpecularColor |
The color of the specular component of the light represented by this object.
The specular color is the color on portions of the surface where light bounces off an object and towards the camera.