Added KRShaderManager::Includer

Now able to include shaders from other shaders with GL_GOOGLE_include_directive.
Added vulkan_test_include.glsl and included it from vulkan_test.vert.
This commit is contained in:
2022-08-15 19:48:59 -07:00
parent 7433d54c16
commit 2085908017
5 changed files with 61 additions and 2 deletions

View File

@@ -7,3 +7,4 @@ add_standard_asset(vulkan_test.vert)
add_standard_asset(vulkan_test.frag)
add_standard_asset(debug_font.vert)
add_standard_asset(debug_font.frag)
add_standard_asset(vulkan_test_include.glsl)

View File

@@ -1,4 +1,7 @@
#version 450
#extension GL_GOOGLE_include_directive : enable
#include "vulkan_test_include.glsl"
// Temporary test shader for vulkan bringup...
// See https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules
@@ -17,5 +20,5 @@ layout( push_constant ) uniform constants
void main() {
gl_Position = vec4(vertex_position * 0.5, 1.0);
fragColor = vertex_normal * 0.25 + vec3(0.5, 0.5, 0.5);
fragColor = vertex_normal * 0.25 + vec3(0.5, 0.5, 0.5) * VULKAN_TEST_BRIGHTNESS;
}

View File

@@ -0,0 +1,2 @@
#define VULKAN_TEST_BRIGHTNESS 0.25