From ba18f97d223e6c201f7f8250b6ce239373852407 Mon Sep 17 00:00:00 2001 From: Elipzer Date: Tue, 18 Sep 2018 16:26:51 -0400 Subject: [PATCH] Fixed LitVS from illegally using a struct as an input param --- OpenGLEngine/LitVS.glsl | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/OpenGLEngine/LitVS.glsl b/OpenGLEngine/LitVS.glsl index e9a90ba..5085434 100644 --- a/OpenGLEngine/LitVS.glsl +++ b/OpenGLEngine/LitVS.glsl @@ -1,12 +1,5 @@ #version 430 -struct Vertex -{ - vec3 position; - vec3 normal; - vec4 material; -}; - struct Fragment { vec3 position; @@ -14,7 +7,10 @@ struct Fragment vec4 material; }; -layout(location = 0) in Vertex vertex; +layout(location = 0) in vec3 vertex_position; +layout(location = 1) in vec3 vertex_normal; +layout(location = 2) in vec4 vertex_material; + layout(location = 3) in mat4 model_to_world; layout(location = 0) uniform mat4 world_to_projection; @@ -23,10 +19,10 @@ out Fragment fragment; void main() { - vec4 model_position = model_to_world * vec4(vertex.position, 1.0); - vec4 model_normal = model_to_world * vec4(vertex.normal, 0.0); + vec4 model_position = model_to_world * vec4(vertex_position, 1.0); + vec4 model_normal = model_to_world * vec4(vertex_normal, 0.0); gl_Position = world_to_projection * model_position; fragment.position = model_position.xyz; fragment.normal = model_normal.xyz; - fragment.material = vertex.material; + fragment.material = vertex_material; } \ No newline at end of file