Use new @include preprocessor added to CyberarmEngin::Shader

This commit is contained in:
2020-01-28 10:48:47 -06:00
parent e7b84bd123
commit c25df59819
7 changed files with 23 additions and 36 deletions

View File

@@ -1,20 +1,6 @@
# version 330 core
const int MAX_LIGHTS = 4;
struct Light {
float end;
float type;
vec3 position;
vec3 diffuse;
vec3 ambient;
vec3 specular;
vec3 direction;
float intensity;
};
@include "light_struct"
in vec3 outPosition;
in vec3 outColor;
@@ -93,4 +79,4 @@ void main() {
vec3 result = calculateLighting() * outColor;
gl_FragColor = vec4(result, 1.0);
}
}

View File

@@ -0,0 +1,15 @@
const int MAX_LIGHTS = 4;
struct Light {
float end;
float type;
vec3 position;
vec3 diffuse;
vec3 ambient;
vec3 specular;
vec3 direction;
float intensity;
};

View File

@@ -1,19 +1,6 @@
# version 330 core
const int MAX_LIGHTS = 4;
struct Light {
float end;
float type;
vec3 position;
vec3 diffuse;
vec3 ambient;
vec3 specular;
vec3 direction;
float intensity;
};
@include "light_struct"
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
@@ -59,4 +46,4 @@ void main() {
outFragPos = vec3(model * vec4(inPosition, 1.0));
gl_Position = projection * view * model * vec4(inPosition, 1.0);
}
}