| 123456789101112131415161718192021222324252627 |
- #version 460 core
- //--------------------------------------------------------------------------------------
- // Globals
- //--------------------------------------------------------------------------------------
- layout(std140, binding = 2) uniform cbObjectColors
- {
- vec4 g_vDiffuseObjectColor;
- vec4 g_vAmbientObjectColor;
- bool g_bHasTexture;
- };
- // interpolated values from vertex shader
- in vec2 uv;
- in vec4 diffuse;
- // output data
- out vec4 color;
- uniform sampler2D texture_sampler;
- void main() {
- if (g_bHasTexture)
- color = texture(texture_sampler, uv) * diffuse;
- else
- color = diffuse;
- }
|