Changeset 6385d0f in opengl-game for shaders/asteroid.vert


Ignore:
Timestamp:
Apr 17, 2020, 3:09:05 AM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
4994692
Parents:
a52ba87
Message:

Change all shaders to have 3-space indentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/asteroid.vert

    ra52ba87 r6385d0f  
    1414
    1515layout(binding = 1) readonly buffer StorageBufferObject {
    16     Object objects[];
     16   Object objects[];
    1717} sbo;
    1818
     
    3333
    3434void main() {
    35   position_eye = vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_position, 1.0));
    36   normal_eye = normalize(vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_normal, 0.0)));
     35   position_eye = vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_position, 1.0));
     36   normal_eye = normalize(vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_normal, 0.0)));
    3737
    38   float hp_percent = sbo.objects[obj_index].hp / 10.0;
    39   vec3 damage_color = vec3(1.0, 0.0, 0.0);
    40   color = (vertex_color * hp_percent) + (damage_color * (1.0 - hp_percent));
     38   float hp_percent = sbo.objects[obj_index].hp / 10.0;
     39   vec3 damage_color = vec3(1.0, 0.0, 0.0);
     40   color = (vertex_color * hp_percent) + (damage_color * (1.0 - hp_percent));
    4141
    42   light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0));
    43   light2_position_eye = vec3(ubo.view * vec4(light2_position_world, 1.0));
     42   light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0));
     43   light2_position_eye = vec3(ubo.view * vec4(light2_position_world, 1.0));
    4444
    45   if (sbo.objects[obj_index].deleted) {
    46      gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
    47   } else {
    48     gl_Position = ubo.proj * vec4(position_eye, 1.0);
    49   }
     45   if (sbo.objects[obj_index].deleted) {
     46      gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
     47   } else {
     48      gl_Position = ubo.proj * vec4(position_eye, 1.0);
     49   }
    5050}
Note: See TracChangeset for help on using the changeset viewer.