Changeset 14ff67c in opengl-game for texture.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
-
texture.vert
re165b85 r14ff67c 1 1 #version 410 2 2 3 uniform mat4 model, view, proj; 3 #define MAX_NUM_OBJECTS 1024 4 5 uniform mat4 view, proj; 6 7 layout (std140) uniform models { 8 mat4 model_mats[MAX_NUM_OBJECTS]; 9 }; 4 10 5 11 layout(location = 0) in vec3 vertex_position; 6 12 layout(location = 1) in vec2 vt; 7 13 layout(location = 2) in vec3 vertex_normal; 14 layout(location = 3) in uint ubo_index; 8 15 9 16 out vec2 texture_coordinates; … … 14 21 15 22 void main() { 16 position_eye = vec3(view * model * vec4(vertex_position, 1.0));17 normal_eye = vec3(view * model * vec4 (vertex_normal, 0.0));23 position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0)); 24 normal_eye = vec3(view * model_mats[ubo_index] * vec4 (vertex_normal, 0.0)); 18 25 texture_coordinates = vt; 19 26 light_position_eye = vec3(view * vec4(light_position_world, 1.0));
Note:
See TracChangeset
for help on using the changeset viewer.