Pong/resources/shaders/Skybox.frag

20 lines
401 B
GLSL
Raw Normal View History

2024-07-01 19:55:24 -07:00
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec3 skyboxUV;
layout(location = 0) out vec4 result;
layout(std140, binding = 1) uniform Opt
{
bool preMultiply;
} opt;
layout(binding = 2) uniform samplerCube skybox;
void main()
{
result = texture(skybox, skyboxUV);
if (opt.preMultiply)
result = vec4(result.rgb * result.a, result.a);
}