mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 21:22:33 +00:00
Added support for rendering multiple lights, standardized shaders to use snake case for variables and camel case for functions, stubbed PBR material shader include.
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
#version 330 core
|
||||
@include "light_struct"
|
||||
|
||||
layout (location = 0) in vec3 inPosition;
|
||||
layout (location = 1) in vec2 inTexCoords;
|
||||
layout (location = 0) in vec3 in_position;
|
||||
layout (location = 1) in vec2 in_tex_coords;
|
||||
|
||||
uniform sampler2D diffuse, position, texcoord, normal, depth;
|
||||
uniform Light light[1];
|
||||
uniform int light_count;
|
||||
uniform Light lights[7];
|
||||
|
||||
out vec2 outTexCoords;
|
||||
flat out Light outLight[1];
|
||||
out vec2 out_tex_coords;
|
||||
flat out int out_light_count;
|
||||
flat out Light out_lights[7];
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(inPosition.x, inPosition.y, inPosition.z, 1.0);
|
||||
outTexCoords = inTexCoords;
|
||||
outLight = light;
|
||||
}
|
||||
gl_Position = vec4(in_position.x, in_position.y, in_position.z, 1.0);
|
||||
out_tex_coords = in_tex_coords;
|
||||
out_light_count = light_count;
|
||||
|
||||
for(int i = 0; i < light_count; i++)
|
||||
{
|
||||
out_lights[i] = lights[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user