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:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
2
standard_assets/shaders/vulkan_test_include.glsl
Normal file
2
standard_assets/shaders/vulkan_test_include.glsl
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
#define VULKAN_TEST_BRIGHTNESS 0.25
|
||||
Reference in New Issue
Block a user