mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-01 20:27:54 +08:00
First time running
This commit is contained in:
@@ -109,7 +109,7 @@ public:
|
||||
if (Zoom < 1.0f)
|
||||
Zoom = 1.0f;
|
||||
if (Zoom > 45.0f)
|
||||
Zoom = 45.0f;
|
||||
Zoom = 45.0f;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -127,4 +127,4 @@ private:
|
||||
Up = glm::normalize(glm::cross(Right, Front));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -168,7 +168,7 @@ void main()
|
||||
vec3 specular = LTC_Evaluate(N, V, P, Minv, translatedPoints, areaLight.twoSided);
|
||||
|
||||
// GGX BRDF shadowing and Fresnel
|
||||
// t2.x: shadowedF90 ??? (F90 normally it should be 1.0)
|
||||
// t2.x: shadowedF90 (F90 normally it should be 1.0)
|
||||
// t2.y: Smith function for Geometric Attenuation Term, it is dot(V or L, H).
|
||||
specular *= mSpecular*t2.x + (1.0f - mSpecular) * t2.y;
|
||||
|
||||
|
||||
9
src/8.guest/2022/7.area_lights/7.light_plane.fs
Normal file
9
src/8.guest/2022/7.area_lights/7.light_plane.fs
Normal file
@@ -0,0 +1,9 @@
|
||||
#version 330 core
|
||||
|
||||
out vec4 color;
|
||||
uniform vec3 lightColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = vec4(lightColor, 1.0f);
|
||||
}
|
||||
14
src/8.guest/2022/7.area_lights/7.light_plane.vs
Normal file
14
src/8.guest/2022/7.area_lights/7.light_plane.vs
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 330 core
|
||||
|
||||
layout (location = 0) in vec3 aPosition;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
layout (location = 2) in vec2 aTexcoord;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * view * model * vec4(aPosition, 1.0f);
|
||||
}
|
||||
@@ -20,27 +20,27 @@
|
||||
|
||||
// CUSTOM
|
||||
#include "ltc_matrix.hpp"
|
||||
#include "colors.hpp"
|
||||
|
||||
// FUNCTION PROTOTYPES
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
|
||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode);
|
||||
void mouse_callback(GLFWwindow* window, double xpos, double ypos);
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
|
||||
void processInput(GLFWwindow *window);
|
||||
void do_movement(GLfloat deltaTime);
|
||||
unsigned int loadTexture(const char *path, bool gammaCorrection);
|
||||
void renderQuad();
|
||||
void renderCube();
|
||||
|
||||
// settings
|
||||
// SETTINGS AND GLOBALS
|
||||
const unsigned int SCR_WIDTH = 800;
|
||||
const unsigned int SCR_HEIGHT = 600;
|
||||
bool bloom = true;
|
||||
float exposure = 1.0f;
|
||||
int programChoice = 1;
|
||||
float bloomFilterRadius = 0.005f;
|
||||
bool keys[1024]; // activated keys
|
||||
glm::vec3 areaLightTranslate;
|
||||
Shader* ltcShaderPtr;
|
||||
|
||||
// camera
|
||||
Camera camera(glm::vec3(0.0f, 0.0f, 5.0f));
|
||||
Camera camera(glm::vec3(0.0f, 1.0f, 0.5f), glm::vec3(0.0f, 1.0f, 0.0f), 0.0f, 0.0f);
|
||||
float lastX = (float)SCR_WIDTH / 2.0;
|
||||
float lastY = (float)SCR_HEIGHT / 2.0;
|
||||
bool firstMouse = true;
|
||||
@@ -58,22 +58,22 @@ float lastFrame = 0.0f;
|
||||
// |/ / |
|
||||
// 1-4---6
|
||||
//
|
||||
struct Vertex {
|
||||
struct VertexAL {
|
||||
glm::vec3 position;
|
||||
glm::vec3 normal;
|
||||
glm::vec2 texcoord;
|
||||
};
|
||||
|
||||
const GLfloat size = 10.0f;
|
||||
Vertex planeVertices[6] = {
|
||||
{ {-size, 0.0f, -size}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f} },
|
||||
{ {-size, 0.0f, size}, {0.0f, 1.0f, 0.0f}, {0.0f, 1.0f} },
|
||||
{ { size, 0.0f, size}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f} },
|
||||
{ {-size, 0.0f, -size}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f} },
|
||||
{ { size, 0.0f, size}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f} },
|
||||
{ { size, 0.0f, -size}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f} }
|
||||
const GLfloat psize = 10.0f;
|
||||
VertexAL planeVertices[6] = {
|
||||
{ {-psize, 0.0f, -psize}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f} },
|
||||
{ {-psize, 0.0f, psize}, {0.0f, 1.0f, 0.0f}, {0.0f, 1.0f} },
|
||||
{ { psize, 0.0f, psize}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f} },
|
||||
{ {-psize, 0.0f, -psize}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f} },
|
||||
{ { psize, 0.0f, psize}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f} },
|
||||
{ { psize, 0.0f, -psize}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f} }
|
||||
};
|
||||
Vertex areaLightVertices[6] = {
|
||||
VertexAL areaLightVertices[6] = {
|
||||
{ {-8.0f, 2.4f, -1.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f} }, // 0 1 5 4
|
||||
{ {-8.0f, 2.4f, 1.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f} },
|
||||
{ {-8.0f, 0.4f, 1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f, 1.0f} },
|
||||
@@ -204,9 +204,9 @@ void incrementRoughness(float step)
|
||||
roughness += step;
|
||||
roughness = glm::clamp(roughness, 0.0f, 1.0f);
|
||||
//std::cout << "roughness: " << roughness << '\n';
|
||||
lightingShader->Activate();
|
||||
lightingShader->SetUniformVec4("material.albedoRoughness", glm::vec4(color, roughness));
|
||||
lightingShader->Deactivate();
|
||||
ltcShaderPtr->use();
|
||||
ltcShaderPtr->setVec4("material.albedoRoughness", glm::vec4(color, roughness));
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void incrementLightIntensity(float step)
|
||||
@@ -215,9 +215,9 @@ void incrementLightIntensity(float step)
|
||||
intensity += step;
|
||||
intensity = glm::clamp(intensity, 0.0f, 10.0f);
|
||||
//std::cout << "intensity: " << intensity << '\n';
|
||||
lightingShader->Activate();
|
||||
lightingShader->SetUniformFloat("areaLight.intensity", intensity);
|
||||
lightingShader->Deactivate();
|
||||
ltcShaderPtr->use();
|
||||
ltcShaderPtr->setFloat("areaLight.intensity", intensity);
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void switchTwoSided(bool doSwitch)
|
||||
@@ -225,9 +225,9 @@ void switchTwoSided(bool doSwitch)
|
||||
static bool twoSided = true;
|
||||
if (doSwitch) twoSided = !twoSided;
|
||||
//std::cout << "twoSided: " << std::boolalpha << twoSided << '\n';
|
||||
lightingShader->Activate();
|
||||
lightingShader->SetUniformBool("areaLight.twoSided", twoSided);
|
||||
lightingShader->Deactivate();
|
||||
ltcShaderPtr->use();
|
||||
ltcShaderPtr->setFloat("areaLight.twoSided", twoSided);
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -276,19 +276,21 @@ int main()
|
||||
// -----------------------------
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
// build and compile shaders
|
||||
// -------------------------
|
||||
// LUT textures
|
||||
LTC_matrices mLTC;
|
||||
mLTC.mat1 = loadMTexture();
|
||||
mLTC.mat2 = loadLUTTexture();
|
||||
|
||||
// SHADERS
|
||||
Shader shaderLTC("7.area_light.vs", "7.area_light.fs");
|
||||
// Shader shaderLight("6.bloom.vs", "6.light_box.fs");
|
||||
// Shader shaderBlur("6.old_blur.vs", "6.old_blur.fs");
|
||||
// Shader shaderBloomFinal("6.bloom_final.vs", "6.bloom_final.fs");
|
||||
ltcShaderPtr = &shaderLTC;
|
||||
Shader shaderLightPlane("7.light_plane.vs", "7.light_plane.fs");
|
||||
|
||||
// load textures
|
||||
// -------------
|
||||
unsigned int concreteTexture = loadTexture(FileSystem::getPath("resources/textures/concreteTexture.jpg").c_str(), true);
|
||||
// TEXTURES
|
||||
unsigned int concreteTexture = loadTexture(
|
||||
FileSystem::getPath("resources/textures/concreteTexture.jpg").c_str(), true);
|
||||
|
||||
// shader configuration
|
||||
// --------------------
|
||||
// SHADER CONFIGURATION
|
||||
shaderLTC.use();
|
||||
shaderLTC.setVec3("areaLight.points[0]", areaLightVertices[0].position);
|
||||
shaderLTC.setVec3("areaLight.points[1]", areaLightVertices[1].position);
|
||||
@@ -303,180 +305,70 @@ int main()
|
||||
switchTwoSided(false);
|
||||
glUseProgram(0);
|
||||
|
||||
shaderLightPlane.use();
|
||||
{
|
||||
glm::mat4 model(1.0f);
|
||||
shaderLightPlane.setMat4("model", model);
|
||||
}
|
||||
shaderLightPlane.setVec3("lightColor", Color::White);
|
||||
glUseProgram(0);
|
||||
|
||||
// shader.setInt("diffuseTexture", 0);
|
||||
// shaderBlur.use();
|
||||
// shaderBlur.setInt("image", 0);
|
||||
// shaderBloomFinal.use();
|
||||
// shaderBloomFinal.setInt("scene", 0);
|
||||
// shaderBloomFinal.setInt("bloomBlur", 1);
|
||||
// 3D OBJECTS
|
||||
configureMockupData();
|
||||
areaLightTranslate = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
// render loop
|
||||
// -----------
|
||||
|
||||
// RENDER LOOP
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
float currentFrame = static_cast<float>(glfwGetTime());
|
||||
deltaTime = currentFrame - lastFrame;
|
||||
lastFrame = currentFrame;
|
||||
|
||||
// input
|
||||
// -----
|
||||
processInput(window);
|
||||
glfwPollEvents();
|
||||
do_movement(deltaTime);
|
||||
|
||||
// render
|
||||
// ------
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// 1. render scene into floating point framebuffer
|
||||
// -----------------------------------------------
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, hdrFBO);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
|
||||
glm::mat4 view = camera.GetViewMatrix();
|
||||
glm::mat4 model = glm::mat4(1.0f);
|
||||
shader.use();
|
||||
shader.setMat4("projection", projection);
|
||||
shader.setMat4("view", view);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, woodTexture);
|
||||
// set lighting uniforms
|
||||
for (unsigned int i = 0; i < lightPositions.size(); i++)
|
||||
{
|
||||
shader.setVec3("lights[" + std::to_string(i) + "].Position", lightPositions[i]);
|
||||
shader.setVec3("lights[" + std::to_string(i) + "].Color", lightColors[i]);
|
||||
}
|
||||
shader.setVec3("viewPos", camera.Position);
|
||||
// create one large cube that acts as the floor
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(0.0f, -1.0f, 0.0));
|
||||
model = glm::scale(model, glm::vec3(12.5f, 0.5f, 12.5f));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
// then create multiple cubes as the scenery
|
||||
glBindTexture(GL_TEXTURE_2D, containerTexture);
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(0.0f, 1.5f, 0.0));
|
||||
model = glm::scale(model, glm::vec3(0.5f));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
shaderLTC.use();
|
||||
glm::mat4 model(1.0f);
|
||||
glm::mat3 normalMatrix = glm::mat3(model);
|
||||
shaderLTC.setMat4("model", model);
|
||||
shaderLTC.setMat3("normalMatrix", normalMatrix);
|
||||
glm::mat4 view = camera.GetViewMatrix();
|
||||
shaderLTC.setMat4("view", view);
|
||||
glm::mat4 projection = glm::perspective(
|
||||
glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
|
||||
shaderLTC.setMat4("projection", projection);
|
||||
shaderLTC.setVec3("viewPosition", camera.Position);
|
||||
shaderLTC.setVec3("areaLightTranslate", areaLightTranslate);
|
||||
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(2.0f, 0.0f, 1.0));
|
||||
model = glm::scale(model, glm::vec3(0.5f));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, mLTC.mat1);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, mLTC.mat2);
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_2D, concreteTexture);
|
||||
renderPlane();
|
||||
glUseProgram(0);
|
||||
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(-1.0f, -1.0f, 2.0));
|
||||
model = glm::rotate(model, glm::radians(60.0f), glm::normalize(glm::vec3(1.0, 0.0, 1.0)));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
shaderLightPlane.use();
|
||||
model = glm::translate(model, areaLightTranslate);
|
||||
shaderLightPlane.setMat4("model", model);
|
||||
shaderLightPlane.setMat4("view", view);
|
||||
shaderLightPlane.setMat4("projection", projection);
|
||||
renderAreaLight();
|
||||
glUseProgram(0);
|
||||
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(0.0f, 2.7f, 4.0));
|
||||
model = glm::rotate(model, glm::radians(23.0f), glm::normalize(glm::vec3(1.0, 0.0, 1.0)));
|
||||
model = glm::scale(model, glm::vec3(1.25));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(-2.0f, 1.0f, -3.0));
|
||||
model = glm::rotate(model, glm::radians(124.0f), glm::normalize(glm::vec3(1.0, 0.0, 1.0)));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(-3.0f, 0.0f, 0.0));
|
||||
model = glm::scale(model, glm::vec3(0.5f));
|
||||
shader.setMat4("model", model);
|
||||
renderCube();
|
||||
|
||||
// finally show all the light sources as bright cubes
|
||||
shaderLight.use();
|
||||
shaderLight.setMat4("projection", projection);
|
||||
shaderLight.setMat4("view", view);
|
||||
|
||||
for (unsigned int i = 0; i < lightPositions.size(); i++)
|
||||
{
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(lightPositions[i]));
|
||||
model = glm::scale(model, glm::vec3(0.25f));
|
||||
shaderLight.setMat4("model", model);
|
||||
shaderLight.setVec3("lightColor", lightColors[i]);
|
||||
renderCube();
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
if (programChoice < 1 || programChoice > 3) { programChoice = 1; }
|
||||
bloom = (programChoice == 1) ? false : true;
|
||||
bool horizontal = true;
|
||||
|
||||
// 2.A) bloom is disabled
|
||||
// ----------------------
|
||||
if (programChoice == 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 2.B) blur bright fragments with two-pass Gaussian Blur
|
||||
// ------------------------------------------------------
|
||||
else if (programChoice == 2)
|
||||
{
|
||||
bool first_iteration = true;
|
||||
unsigned int amount = 10;
|
||||
shaderBlur.use();
|
||||
for (unsigned int i = 0; i < amount; i++)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, pingpongFBO[horizontal]);
|
||||
shaderBlur.setInt("horizontal", horizontal);
|
||||
glBindTexture(GL_TEXTURE_2D, first_iteration ? colorBuffers[1] : pingpongColorbuffers[!horizontal]); // bind texture of other framebuffer (or scene if first iteration)
|
||||
renderQuad();
|
||||
horizontal = !horizontal;
|
||||
if (first_iteration)
|
||||
first_iteration = false;
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
// 2.C) use unthresholded bloom with progressive downsample/upsampling
|
||||
// -------------------------------------------------------------------
|
||||
else if (programChoice == 3)
|
||||
{
|
||||
bloomRenderer.RenderBloomTexture(colorBuffers[1], bloomFilterRadius);
|
||||
}
|
||||
|
||||
// 3. now render floating point color buffer to 2D quad and tonemap HDR colors to default framebuffer's (clamped) color range
|
||||
// --------------------------------------------------------------------------------------------------------------------------
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
shaderBloomFinal.use();
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, colorBuffers[0]);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
if (programChoice == 1) {
|
||||
glBindTexture(GL_TEXTURE_2D, 0); // trick to bind invalid texture "0", we don't care either way!
|
||||
}
|
||||
if (programChoice == 2) {
|
||||
glBindTexture(GL_TEXTURE_2D, pingpongColorbuffers[!horizontal]);
|
||||
}
|
||||
else if (programChoice == 3) {
|
||||
glBindTexture(GL_TEXTURE_2D, bloomRenderer.BloomTexture());
|
||||
}
|
||||
shaderBloomFinal.setInt("programChoice", programChoice);
|
||||
shaderBloomFinal.setFloat("exposure", exposure);
|
||||
renderQuad();
|
||||
|
||||
//std::cout << "bloom: " << (bloom ? "on" : "off") << "| exposure: " << exposure << std::endl;
|
||||
|
||||
// glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
|
||||
// -------------------------------------------------------------------------------
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
bloomRenderer.Destroy();
|
||||
glDeleteVertexArrays(1, &planeVAO);
|
||||
glDeleteBuffers(1, &planeVBO);
|
||||
glDeleteVertexArrays(1, &areaLightVAO);
|
||||
glDeleteBuffers(1, &areaLightVBO);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
||||
@@ -487,24 +379,17 @@ int main()
|
||||
// ---------------------------------------------------------------------------------------------------------
|
||||
void do_movement(GLfloat deltaTime)
|
||||
{
|
||||
GLfloat cameraSpeed = 10.0f * deltaTime;
|
||||
|
||||
if(keys[GLFW_KEY_W]) {
|
||||
cam->MoveForwards(cameraSpeed);
|
||||
camera.ProcessKeyboard(FORWARD, deltaTime);
|
||||
}
|
||||
else if(keys[GLFW_KEY_S]) {
|
||||
cam->MoveBackwards(cameraSpeed);
|
||||
camera.ProcessKeyboard(BACKWARD, deltaTime);
|
||||
}
|
||||
if(keys[GLFW_KEY_A]) {
|
||||
cam->StrafeLeft(cameraSpeed);
|
||||
camera.ProcessKeyboard(LEFT, deltaTime);
|
||||
}
|
||||
else if(keys[GLFW_KEY_D]) {
|
||||
cam->StrafeRight(cameraSpeed);
|
||||
}
|
||||
|
||||
if (keys[GLFW_KEY_Z]) {
|
||||
if (keys[GLFW_KEY_LEFT_SHIFT]) cam->MoveDown(cameraSpeed);
|
||||
else cam->MoveUp(cameraSpeed);
|
||||
camera.ProcessKeyboard(RIGHT, deltaTime);
|
||||
}
|
||||
|
||||
if (keys[GLFW_KEY_R]) {
|
||||
@@ -542,13 +427,6 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
||||
case GLFW_KEY_ESCAPE:
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
return;
|
||||
case GLFW_KEY_L:
|
||||
screen_lock = !screen_lock;
|
||||
break;
|
||||
case GLFW_KEY_C:
|
||||
lightingShader = new Shaders::ShaderWrapper(shadername, Shaders::SHADERS_VF);
|
||||
recompileShader = true;
|
||||
break;
|
||||
case GLFW_KEY_B:
|
||||
switchTwoSided(true);
|
||||
break;
|
||||
|
||||
152
src/8.guest/2022/7.area_lights/colors.hpp
Normal file
152
src/8.guest/2022/7.area_lights/colors.hpp
Normal file
@@ -0,0 +1,152 @@
|
||||
#pragma once
|
||||
|
||||
// GLM
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
||||
// Color values found at:
|
||||
// https://www.rapidtables.com/web/color/RGB_Color.html
|
||||
|
||||
class Color
|
||||
{
|
||||
public:
|
||||
static inline glm::vec3 Maroon = glm::vec3(0.501961f, 0.0f, 0.0f);
|
||||
static inline glm::vec3 DarkRed = glm::vec3(0.545098f, 0.0f, 0.0f);
|
||||
static inline glm::vec3 Brown = glm::vec3(0.647059f, 0.164706f, 0.164706f);
|
||||
static inline glm::vec3 Firebrick = glm::vec3(0.698039f, 0.133333f, 0.133333f);
|
||||
static inline glm::vec3 Crimson = glm::vec3(0.862745f, 0.0784314f, 0.235294f);
|
||||
static inline glm::vec3 Red = glm::vec3(1.0f, 0.0f, 0.0f);
|
||||
static inline glm::vec3 Tomato = glm::vec3(1.0f, 0.388235f, 0.278431f);
|
||||
static inline glm::vec3 Coral = glm::vec3(1.0f, 0.498039f, 0.313726f);
|
||||
static inline glm::vec3 IndianRed = glm::vec3(0.803922f, 0.360784f, 0.360784f);
|
||||
static inline glm::vec3 LightCoral = glm::vec3(0.941176f, 0.501961f, 0.501961f);
|
||||
static inline glm::vec3 DarkSalmon = glm::vec3(0.913725f, 0.588235f, 0.478431f);
|
||||
static inline glm::vec3 Salmon = glm::vec3(0.980392f, 0.501961f, 0.447059f);
|
||||
static inline glm::vec3 LightSalmon = glm::vec3(1.0f, 0.627451f, 0.478431f);
|
||||
static inline glm::vec3 OrangeRed = glm::vec3(1.0f, 0.270588f, 0.0f);
|
||||
static inline glm::vec3 DarkOrange = glm::vec3(1.0f, 0.54902f, 0.0f);
|
||||
static inline glm::vec3 Orange = glm::vec3(1.0f, 0.647059f, 0.0f);
|
||||
static inline glm::vec3 Gold = glm::vec3(1.0f, 0.843137f, 0.0f);
|
||||
static inline glm::vec3 DarkGoldenRod = glm::vec3(0.721569f, 0.52549f, 0.0431373f);
|
||||
static inline glm::vec3 GoldenRod = glm::vec3(0.854902f, 0.647059f, 0.12549f);
|
||||
static inline glm::vec3 PaleGoldenRod = glm::vec3(0.933333f, 0.909804f, 0.666667f);
|
||||
static inline glm::vec3 DarkKhaki = glm::vec3(0.741176f, 0.717647f, 0.419608f);
|
||||
static inline glm::vec3 Khaki = glm::vec3(0.941176f, 0.901961f, 0.54902f);
|
||||
static inline glm::vec3 Olive = glm::vec3(0.501961f, 0.501961f, 0.0f);
|
||||
static inline glm::vec3 Yellow = glm::vec3(1.0f, 1.0f, 0.0f);
|
||||
static inline glm::vec3 YellowGreen = glm::vec3(0.603922f, 0.803922f, 0.196078f);
|
||||
static inline glm::vec3 DarkOliveGreen = glm::vec3(0.333333f, 0.419608f, 0.184314f);
|
||||
static inline glm::vec3 OliveDrab = glm::vec3(0.419608f, 0.556863f, 0.137255f);
|
||||
static inline glm::vec3 LawnGreen = glm::vec3(0.486275f, 0.988235f, 0.0f);
|
||||
static inline glm::vec3 ChartReuse = glm::vec3(0.498039f, 1.0f, 0.0f);
|
||||
static inline glm::vec3 GreenYellow = glm::vec3(0.678431f, 1.0f, 0.184314f);
|
||||
static inline glm::vec3 DarkGreen = glm::vec3(0.0f, 0.392157f, 0.0f);
|
||||
static inline glm::vec3 Green = glm::vec3(0.0f, 0.501961f, 0.0f);
|
||||
static inline glm::vec3 ForestGreen = glm::vec3(0.133333f, 0.545098f, 0.133333f);
|
||||
static inline glm::vec3 Lime = glm::vec3(0.0f, 1.0f, 0.0f);
|
||||
static inline glm::vec3 LimeGreen = glm::vec3(0.196078f, 0.803922f, 0.196078f);
|
||||
static inline glm::vec3 LightGreen = glm::vec3(0.564706f, 0.933333f, 0.564706f);
|
||||
static inline glm::vec3 PaleGreen = glm::vec3(0.596078f, 0.984314f, 0.596078f);
|
||||
static inline glm::vec3 DarkSeaGreen = glm::vec3(0.560784f, 0.737255f, 0.560784f);
|
||||
static inline glm::vec3 MediumSpringGreen = glm::vec3(0.0f, 0.980392f, 0.603922f);
|
||||
static inline glm::vec3 SpringGreen = glm::vec3(0.0f, 1.0f, 0.498039f);
|
||||
static inline glm::vec3 SeaGreen = glm::vec3(0.180392f, 0.545098f, 0.341176f);
|
||||
static inline glm::vec3 MediumAquaMarine = glm::vec3(0.4f, 0.803922f, 0.666667f);
|
||||
static inline glm::vec3 MediumSeaGreen = glm::vec3(0.235294f, 0.701961f, 0.443137f);
|
||||
static inline glm::vec3 LightSeaGreen = glm::vec3(0.12549f, 0.698039f, 0.666667f);
|
||||
static inline glm::vec3 DarkSlateGray = glm::vec3(0.184314f, 0.309804f, 0.309804f);
|
||||
static inline glm::vec3 Teal = glm::vec3(0.0f, 0.501961f, 0.501961f);
|
||||
static inline glm::vec3 DarkCyan = glm::vec3(0.0f, 0.545098f, 0.545098f);
|
||||
static inline glm::vec3 Aqua = glm::vec3(0.0f, 1.0f, 1.0f);
|
||||
static inline glm::vec3 Cyan = glm::vec3(0.0f, 1.0f, 1.0f);
|
||||
static inline glm::vec3 LightCyan = glm::vec3(0.878431f, 1.0f, 1.0f);
|
||||
static inline glm::vec3 DarkTurquoise = glm::vec3(0.0f, 0.807843f, 0.819608f);
|
||||
static inline glm::vec3 Turquoise = glm::vec3(0.25098f, 0.878431f, 0.815686f);
|
||||
static inline glm::vec3 MediumTurquoise = glm::vec3(0.282353f, 0.819608f, 0.8f);
|
||||
static inline glm::vec3 PaleTurquoise = glm::vec3(0.686275f, 0.933333f, 0.933333f);
|
||||
static inline glm::vec3 Aquamarine = glm::vec3(0.498039f, 1.0f, 0.831373f);
|
||||
static inline glm::vec3 PowderBlue = glm::vec3(0.690196f, 0.878431f, 0.901961f);
|
||||
static inline glm::vec3 CadetBlue = glm::vec3(0.372549f, 0.619608f, 0.627451f);
|
||||
static inline glm::vec3 SteelBlue = glm::vec3(0.27451f, 0.509804f, 0.705882f);
|
||||
static inline glm::vec3 CornflowerBlue = glm::vec3(0.392157f, 0.584314f, 0.929412f);
|
||||
static inline glm::vec3 DeepSkyBlue = glm::vec3(0.0f, 0.74902f, 1.0f);
|
||||
static inline glm::vec3 DodgerBlue = glm::vec3(0.117647f, 0.564706f, 1.0f);
|
||||
static inline glm::vec3 LightBlue = glm::vec3(0.678431f, 0.847059f, 0.901961f);
|
||||
static inline glm::vec3 SkyBlue = glm::vec3(0.529412f, 0.807843f, 0.921569f);
|
||||
static inline glm::vec3 LightSkyBlue = glm::vec3(0.529412f, 0.807843f, 0.980392f);
|
||||
static inline glm::vec3 MidnightBlue = glm::vec3(0.0980392f, 0.0980392f, 0.439216f);
|
||||
static inline glm::vec3 Navy = glm::vec3(0.0f, 0.0f, 0.501961f);
|
||||
static inline glm::vec3 DarkBlue = glm::vec3(0.0f, 0.0f, 0.545098f);
|
||||
static inline glm::vec3 MediumBlue = glm::vec3(0.0f, 0.0f, 0.803922f);
|
||||
static inline glm::vec3 Blue = glm::vec3(0.0f, 0.0f, 1.0f);
|
||||
static inline glm::vec3 RoyalBlue = glm::vec3(0.254902f, 0.411765f, 0.882353f);
|
||||
static inline glm::vec3 BlueViolet = glm::vec3(0.541176f, 0.168627f, 0.886275f);
|
||||
static inline glm::vec3 Indigo = glm::vec3(0.294118f, 0.0f, 0.509804f);
|
||||
static inline glm::vec3 DarkSlateBlue = glm::vec3(0.282353f, 0.239216f, 0.545098f);
|
||||
static inline glm::vec3 SlateBlue = glm::vec3(0.415686f, 0.352941f, 0.803922f);
|
||||
static inline glm::vec3 MediumSlateBlue = glm::vec3(0.482353f, 0.407843f, 0.933333f);
|
||||
static inline glm::vec3 MediumPurple = glm::vec3(0.576471f, 0.439216f, 0.858824f);
|
||||
static inline glm::vec3 DarkMagenta = glm::vec3(0.545098f, 0.0f, 0.545098f);
|
||||
static inline glm::vec3 DarkViolet = glm::vec3(0.580392f, 0.0f, 0.827451f);
|
||||
static inline glm::vec3 DarkOrchid = glm::vec3(0.6f, 0.196078f, 0.8f);
|
||||
static inline glm::vec3 MediumOrchid = glm::vec3(0.729412f, 0.333333f, 0.827451f);
|
||||
static inline glm::vec3 Purple = glm::vec3(0.501961f, 0.0f, 0.501961f);
|
||||
static inline glm::vec3 Thistle = glm::vec3(0.847059f, 0.74902f, 0.847059f);
|
||||
static inline glm::vec3 Plum = glm::vec3(0.866667f, 0.627451f, 0.866667f);
|
||||
static inline glm::vec3 Violet = glm::vec3(0.933333f, 0.509804f, 0.933333f);
|
||||
static inline glm::vec3 Magenta = glm::vec3(1.0f, 0.0f, 1.0f);
|
||||
static inline glm::vec3 Orchid = glm::vec3(0.854902f, 0.439216f, 0.839216f);
|
||||
static inline glm::vec3 MediumVioletRed = glm::vec3(0.780392f, 0.0823529f, 0.521569f);
|
||||
static inline glm::vec3 PaleVioletRed = glm::vec3(0.858824f, 0.439216f, 0.576471f);
|
||||
static inline glm::vec3 DeepPink = glm::vec3(1.0f, 0.0784314f, 0.576471f);
|
||||
static inline glm::vec3 HotPink = glm::vec3(1.0f, 0.411765f, 0.705882f);
|
||||
static inline glm::vec3 LightPink = glm::vec3(1.0f, 0.713726f, 0.756863f);
|
||||
static inline glm::vec3 Pink = glm::vec3(1.0f, 0.752941f, 0.796078f);
|
||||
static inline glm::vec3 AntiqueWhite = glm::vec3(0.980392f, 0.921569f, 0.843137f);
|
||||
static inline glm::vec3 Beige = glm::vec3(0.960784f, 0.960784f, 0.862745f);
|
||||
static inline glm::vec3 Bisque = glm::vec3(1.0f, 0.894118f, 0.768627f);
|
||||
static inline glm::vec3 BlanchedAlmond = glm::vec3(1.0f, 0.921569f, 0.803922f);
|
||||
static inline glm::vec3 Wheat = glm::vec3(0.960784f, 0.870588f, 0.701961f);
|
||||
static inline glm::vec3 CornSilk = glm::vec3(1.0f, 0.972549f, 0.862745f);
|
||||
static inline glm::vec3 LemonChiffon = glm::vec3(1.0f, 0.980392f, 0.803922f);
|
||||
static inline glm::vec3 LightGoldenRodYellow = glm::vec3(0.980392f, 0.980392f, 0.823529f);
|
||||
static inline glm::vec3 LightYellow = glm::vec3(1.0f, 1.0f, 0.878431f);
|
||||
static inline glm::vec3 SaddleBrown = glm::vec3(0.545098f, 0.270588f, 0.0745098f);
|
||||
static inline glm::vec3 Sienna = glm::vec3(0.627451f, 0.321569f, 0.176471f);
|
||||
static inline glm::vec3 Chocolate = glm::vec3(0.823529f, 0.411765f, 0.117647f);
|
||||
static inline glm::vec3 Peru = glm::vec3(0.803922f, 0.521569f, 0.247059f);
|
||||
static inline glm::vec3 SandyBrown = glm::vec3(0.956863f, 0.643137f, 0.376471f);
|
||||
static inline glm::vec3 BurlyWood = glm::vec3(0.870588f, 0.721569f, 0.529412f);
|
||||
static inline glm::vec3 Tan = glm::vec3(0.823529f, 0.705882f, 0.54902f);
|
||||
static inline glm::vec3 RosyBrown = glm::vec3(0.737255f, 0.560784f, 0.560784f);
|
||||
static inline glm::vec3 Moccasin = glm::vec3(1.0f, 0.894118f, 0.709804f);
|
||||
static inline glm::vec3 NavajoWhite = glm::vec3(1.0f, 0.870588f, 0.678431f);
|
||||
static inline glm::vec3 PeachPuff = glm::vec3(1.0f, 0.854902f, 0.72549f);
|
||||
static inline glm::vec3 MistyRose = glm::vec3(1.0f, 0.894118f, 0.882353f);
|
||||
static inline glm::vec3 LavenderBlush = glm::vec3(1.0f, 0.941176f, 0.960784f);
|
||||
static inline glm::vec3 Linen = glm::vec3(0.980392f, 0.941176f, 0.901961f);
|
||||
static inline glm::vec3 OldLace = glm::vec3(0.992157f, 0.960784f, 0.901961f);
|
||||
static inline glm::vec3 PapayaWhip = glm::vec3(1.0f, 0.937255f, 0.835294f);
|
||||
static inline glm::vec3 SeaShell = glm::vec3(1.0f, 0.960784f, 0.933333f);
|
||||
static inline glm::vec3 MintCream = glm::vec3(0.960784f, 1.0f, 0.980392f);
|
||||
static inline glm::vec3 SlateGray = glm::vec3(0.439216f, 0.501961f, 0.564706f);
|
||||
static inline glm::vec3 LightSlateGray = glm::vec3(0.466667f, 0.533333f, 0.6f);
|
||||
static inline glm::vec3 LightSteelBlue = glm::vec3(0.690196f, 0.768627f, 0.870588f);
|
||||
static inline glm::vec3 Lavender = glm::vec3(0.901961f, 0.901961f, 0.980392f);
|
||||
static inline glm::vec3 FloralWhite = glm::vec3(1.0f, 0.980392f, 0.941176f);
|
||||
static inline glm::vec3 AliceBlue = glm::vec3(0.941176f, 0.972549f, 1.0f);
|
||||
static inline glm::vec3 GhostWhite = glm::vec3(0.972549f, 0.972549f, 1.0f);
|
||||
static inline glm::vec3 Honeydew = glm::vec3(0.941176f, 1.0f, 0.941176f);
|
||||
static inline glm::vec3 Ivory = glm::vec3(1.0f, 1.0f, 0.941176f);
|
||||
static inline glm::vec3 Azure = glm::vec3(0.941176f, 1.0f, 1.0f);
|
||||
static inline glm::vec3 Snow = glm::vec3(1.0f, 0.980392f, 0.980392f);
|
||||
static inline glm::vec3 Black = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
static inline glm::vec3 DimGrey = glm::vec3(0.411765f, 0.411765f, 0.411765f);
|
||||
static inline glm::vec3 Grey = glm::vec3(0.501961f, 0.501961f, 0.501961f);
|
||||
static inline glm::vec3 DarkGrey = glm::vec3(0.662745f, 0.662745f, 0.662745f);
|
||||
static inline glm::vec3 Silver = glm::vec3(0.752941f, 0.752941f, 0.752941f);
|
||||
static inline glm::vec3 LightGrey = glm::vec3(0.827451f, 0.827451f, 0.827451f);
|
||||
static inline glm::vec3 Gainsboro = glm::vec3(0.862745f, 0.862745f, 0.862745f);
|
||||
static inline glm::vec3 WhiteSmoke = glm::vec3(0.960784f, 0.960784f, 0.960784f);
|
||||
static inline glm::vec3 White = glm::vec3(1.0f, 1.0f, 1.0f);
|
||||
};
|
||||
Reference in New Issue
Block a user