Шейдер лампочки
This commit is contained in:
parent
aa10fbfa8a
commit
dfcaad6707
|
@ -2,10 +2,11 @@
|
||||||
|
|
||||||
layout(std140, binding = 1) uniform Material
|
layout(std140, binding = 1) uniform Material
|
||||||
{
|
{
|
||||||
vec3 ka;
|
vec3 base_color;
|
||||||
vec3 kd;
|
float roughness;
|
||||||
vec3 ks;
|
float metallic;
|
||||||
float p;
|
float specular;
|
||||||
|
vec3 emitted;
|
||||||
bool normalmapped;
|
bool normalmapped;
|
||||||
bool parallaxmapped;
|
bool parallaxmapped;
|
||||||
bool displacementmapped;
|
bool displacementmapped;
|
||||||
|
@ -19,8 +20,8 @@ layout(std140, binding = 4) uniform gamma
|
||||||
};
|
};
|
||||||
|
|
||||||
layout (location = 1) out vec3 gNormal;
|
layout (location = 1) out vec3 gNormal;
|
||||||
layout (location = 3) out vec4 gAmbientSpecular;
|
|
||||||
layout (location = 4) out uvec3 gID;
|
layout (location = 4) out uvec3 gID;
|
||||||
|
layout (location = 5) out vec3 gEmittedColor;
|
||||||
|
|
||||||
uniform float angle;
|
uniform float angle;
|
||||||
uniform vec3 direction;
|
uniform vec3 direction;
|
||||||
|
@ -31,7 +32,7 @@ void main()
|
||||||
{
|
{
|
||||||
float cosA = dot(normalize(pos_local), normalize(direction));
|
float cosA = dot(normalize(pos_local), normalize(direction));
|
||||||
if (degrees(acos(cosA)) <= angle)
|
if (degrees(acos(cosA)) <= angle)
|
||||||
gAmbientSpecular.rgb = pow(ka, vec3(inv_gamma));
|
gEmittedColor = pow(base_color, vec3(inv_gamma));
|
||||||
else
|
else
|
||||||
discard;
|
discard;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue