2023-02-02 15:22:33 +00:00
|
|
|
#version 420 core
|
|
|
|
|
|
|
|
layout(std140, binding = 1) uniform Material
|
|
|
|
{
|
|
|
|
vec3 ka;
|
|
|
|
vec3 kd;
|
|
|
|
vec3 ks;
|
|
|
|
float p;
|
2023-02-03 12:30:42 +00:00
|
|
|
bool normalmapped;
|
2023-02-09 07:21:02 +00:00
|
|
|
bool parallaxmapped;
|
2023-02-02 15:22:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in vec3 pos_local;
|
|
|
|
|
|
|
|
layout(std140, binding = 4) uniform gamma
|
|
|
|
{
|
|
|
|
float inv_gamma;
|
|
|
|
};
|
|
|
|
|
|
|
|
out vec4 color;
|
|
|
|
|
|
|
|
uniform float angle;
|
|
|
|
uniform vec3 direction;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
float cosA = dot(normalize(pos_local), normalize(direction));
|
|
|
|
if (degrees(acos(cosA)) <= angle)
|
|
|
|
color = vec4(pow(ka, vec3(inv_gamma)), 1);
|
|
|
|
else
|
|
|
|
discard;
|
|
|
|
}
|