Шейдер лампочки

This commit is contained in:
Ковалев Роман Евгеньевич 2023-06-15 14:45:41 +03:00 committed by re.kovalev
parent aa10fbfa8a
commit dfcaad6707
1 changed files with 7 additions and 6 deletions

View File

@ -2,10 +2,11 @@
layout(std140, binding = 1) uniform Material
{
vec3 ka;
vec3 kd;
vec3 ks;
float p;
vec3 base_color;
float roughness;
float metallic;
float specular;
vec3 emitted;
bool normalmapped;
bool parallaxmapped;
bool displacementmapped;
@ -19,8 +20,8 @@ layout(std140, binding = 4) uniform gamma
};
layout (location = 1) out vec3 gNormal;
layout (location = 3) out vec4 gAmbientSpecular;
layout (location = 4) out uvec3 gID;
layout (location = 5) out vec3 gEmittedColor;
uniform float angle;
uniform vec3 direction;
@ -31,7 +32,7 @@ void main()
{
float cosA = dot(normalize(pos_local), normalize(direction));
if (degrees(acos(cosA)) <= angle)
gAmbientSpecular.rgb = pow(ka, vec3(inv_gamma));
gEmittedColor = pow(base_color, vec3(inv_gamma));
else
discard;