|
@ -99,6 +99,7 @@ INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _ |
|
|
gpuProgram.DetectUniform("U_FogStart"); |
|
|
gpuProgram.DetectUniform("U_FogStart"); |
|
|
gpuProgram.DetectUniform("U_FogEnd"); |
|
|
gpuProgram.DetectUniform("U_FogEnd"); |
|
|
gpuProgram.DetectUniform("U_FogColor"); |
|
|
gpuProgram.DetectUniform("U_FogColor"); |
|
|
|
|
|
gpuProgram.DetectUniform("U_FogDensity"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,6 +130,7 @@ INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _ |
|
|
float fogStart = 2.0f; |
|
|
float fogStart = 2.0f; |
|
|
float fogEnd = 23.0f; |
|
|
float fogEnd = 23.0f; |
|
|
float fogColor[] = { 0.6f, 0.6f, 0.6f, 1.0f }; |
|
|
float fogColor[] = { 0.6f, 0.6f, 0.6f, 1.0f }; |
|
|
|
|
|
float fogDensity = 0.11; |
|
|
|
|
|
|
|
|
glm::mat4 cubeModelMatrix = glm::translate<float>(-2.2f, 0.0f, -4.0f) * glm::rotate(-30.0f, 1.0f, 1.0f, 1.0f); |
|
|
glm::mat4 cubeModelMatrix = glm::translate<float>(-2.2f, 0.0f, -4.0f) * glm::rotate(-30.0f, 1.0f, 1.0f, 1.0f); |
|
|
glm::mat4 cubeNormalMatrix = glm::inverseTranspose(cubeModelMatrix); |
|
|
glm::mat4 cubeNormalMatrix = glm::inverseTranspose(cubeModelMatrix); |
|
@ -182,6 +184,7 @@ INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _ |
|
|
glUniform1f(gpuProgram.GetLocation("U_FogStart"), fogStart); |
|
|
glUniform1f(gpuProgram.GetLocation("U_FogStart"), fogStart); |
|
|
glUniform1f(gpuProgram.GetLocation("U_FogEnd"), fogEnd); |
|
|
glUniform1f(gpuProgram.GetLocation("U_FogEnd"), fogEnd); |
|
|
glUniform4fv(gpuProgram.GetLocation("U_FogColor"), 1, fogColor); |
|
|
glUniform4fv(gpuProgram.GetLocation("U_FogColor"), 1, fogColor); |
|
|
|
|
|
glUniform1f(gpuProgram.GetLocation("U_FogDensity"), fogDensity); |
|
|
|
|
|
|
|
|
glUniformMatrix4fv(gpuProgram.GetLocation("M"), 1, GL_FALSE, glm::value_ptr(cubeModelMatrix)); |
|
|
glUniformMatrix4fv(gpuProgram.GetLocation("M"), 1, GL_FALSE, glm::value_ptr(cubeModelMatrix)); |
|
|
glUniformMatrix4fv(gpuProgram.GetLocation("NM"), 1, GL_FALSE, glm::value_ptr(cubeNormalMatrix)); |
|
|
glUniformMatrix4fv(gpuProgram.GetLocation("NM"), 1, GL_FALSE, glm::value_ptr(cubeNormalMatrix)); |
|
|