mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Use new @include preprocessor added to CyberarmEngin::Shader
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
15
shaders/include/light_struct.glsl
Normal file
15
shaders/include/light_struct.glsl
Normal 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;
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user