Skip to content

Instantly share code, notes, and snippets.

@thatcosmonaut
Last active August 15, 2023 05:27
Show Gist options
  • Save thatcosmonaut/a7d1048f9992dee62d45f1d718feb217 to your computer and use it in GitHub Desktop.
Save thatcosmonaut/a7d1048f9992dee62d45f1d718feb217 to your computer and use it in GitHub Desktop.
Ambient lighting
#version 450
layout(location = 0) in vec4 InColor;
layout(location = 0) out vec4 FragColor;
layout(binding = 0, set = 3) uniform UBO
{
vec4 LightColor;
float AmbientStrength;
} ubo;
void main()
{
vec3 ambientColor = ubo.AmbientStrength * ubo.LightColor * InColor;
FragColor = vec4(ambientColor, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment