Changeset 14ff67c in opengl-game for color.vert
- Timestamp:
- May 24, 2018, 2:35:35 AM (7 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 4f3262f
- Parents:
- e165b85
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
color.vert
re165b85 r14ff67c 1 1 #version 410 2 2 3 uniform mat4 model, view, proj; 3 #define MAX_NUM_OBJECTS 1024 4 4 5 layout (std140) uniform shader_data { 6 mat4 model_mat; 5 uniform mat4 view, proj; 6 7 layout (std140) uniform models { 8 mat4 model_mats[MAX_NUM_OBJECTS]; 7 9 }; 8 10 … … 10 12 layout(location = 1) in vec3 vertex_color; 11 13 layout(location = 2) in vec3 vertex_normal; 14 layout(location = 3) in uint ubo_index; 12 15 13 16 out vec3 position_eye, normal_eye, color, light_position_eye; … … 17 20 18 21 void main() { 19 position_eye = vec3(view * model * vec4(vertex_position, 1.0));20 normal_eye = vec3(view * model * vec4 (vertex_normal, 0.0));22 position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0)); 23 normal_eye = vec3(view * model_mats[ubo_index] * vec4 (vertex_normal, 0.0)); 21 24 color = vertex_color; 22 25 light_position_eye = vec3(view * vec4(light_position_world, 1.0));
Note:
See TracChangeset
for help on using the changeset viewer.