Changes in shaders/ship.vert [785333b:cf727ca] in opengl-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/ship.vert
r785333b rcf727ca 18 18 layout(location = 1) in vec3 vertex_color; 19 19 layout(location = 2) in vec3 vertex_normal; 20 //layout(location = 3) in uint ubo_index;20 layout(location = 3) in uint obj_index; 21 21 22 22 layout(location = 0) out vec3 position_eye; … … 33 33 // Check Anton's book to see how to fix this 34 34 void main() { 35 position_eye = vec3(ubo.view * sbo.objects[0].model * vec4(vertex_position, 1.0)); 36 //position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0)); 35 position_eye = vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_position, 1.0)); 37 36 38 37 // Using 0.0 instead of 1.0 means translations won't effect the normal 39 normal_eye = normalize(vec3(ubo.view * sbo.objects[0].model * vec4(vertex_normal, 0.0))); 40 //normal_eye = normalize(vec3(view * model_mats[ubo_index] * vec4(vertex_normal, 0.0))); 38 normal_eye = normalize(vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_normal, 0.0))); 41 39 color = vertex_color; 42 40 light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0)); 43 41 44 //gl_Position = ubo.proj * vec4(position_eye, 1.0); 45 gl_Position = vec4(vertex_position, 1.0); 42 gl_Position = ubo.proj * vec4(position_eye, 1.0); 46 43 }
Note:
See TracChangeset
for help on using the changeset viewer.