playing with another shader for a sun type thing and WAY better camera movement
This commit is contained in:
1 parent
9eb8d55630
commit
b299a8d8a2
5 files changed
+175
-41
No files matched your search
+4
-2
@@ -2,6 +2,7 @@
|
||||
out vec4 FragColor;
|
||||
|
||||
|
||||
uniform float light_power;
|
||||
uniform vec3 lightColor;
|
||||
uniform vec3 objectColor;
|
||||
uniform vec3 viewPos;
|
||||
@@ -10,8 +11,9 @@ in vec3 FragPos;
|
||||
in vec3 Normal;
|
||||
in vec3 LightPos;
|
||||
|
||||
// const float light_power = 12.0;
|
||||
const float ambientStrength = 0.2;
|
||||
const float shininess = 32.0;
|
||||
const float shininess = 64.0;
|
||||
const float screenGamma = 2.2; // Assume the monitor is calibrated to the sRGB color space
|
||||
|
||||
void main()
|
||||
@@ -39,7 +41,7 @@ void main()
|
||||
specular = pow(specAngle, shininess);
|
||||
}
|
||||
|
||||
vec3 colorLinear = (ambient + diffuse + specular) * objectColor;
|
||||
vec3 colorLinear = (ambient + (diffuse * light_power) + (specular * light_power)) * objectColor;
|
||||
|
||||
// vec3 colorGammaCorrected = pow(colorLinear, vec3(1.0 / screenGamma));
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform vec3 lightColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(lightColor, 1.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * view * model * vec4(aPos, 1.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user