Changeset b8efa56 in opengl-game for shaders


Ignore:
Timestamp:
Apr 10, 2021, 1:46:51 AM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
4a777d2
Parents:
8d92284
git-author:
Dmitry Portnoy <dportnoy@…> (04/10/21 01:46:46)
git-committer:
Dmitry Portnoy <dportnoy@…> (04/10/21 01:46:51)
Message:

In VulkanGame, change the asteroid pipeline to use ModelVertex

Location:
shaders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shaders/asteroid.frag

    r8d92284 rb8efa56  
    44layout(location = 0) in vec3 position_eye;
    55layout(location = 1) in vec3 color;
    6 layout(location = 2) in vec3 normal_eye;
    7 layout(location = 3) in vec3 light_position_eye;
    8 layout(location = 4) in vec3 light2_position_eye;
     6layout(location = 2) in vec2 fragTexCoord;
     7layout(location = 3) in vec3 normal_eye;
     8layout(location = 4) in vec3 light_position_eye;
     9layout(location = 5) in vec3 light2_position_eye;
    910
    1011layout(location = 0) out vec4 frag_color;
     
    5253   // specular intensity
    5354   vec3 Is = Ls * Ks * specular_factor;
    54    vec3 Is2 = Ls * Ks * specular_factor2;
     55   vec3 Is2 = Ls * Ks * specular_factor2 + vec3(fragTexCoord, 0.0) - vec3(fragTexCoord, 0.0);
    5556
    5657   frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2)/2, 1.0);
  • shaders/asteroid.vert

    r8d92284 rb8efa56  
    1919layout(location = 0) in vec3 vertex_position;
    2020layout(location = 1) in vec3 vertex_color;
    21 layout(location = 2) in vec3 vertex_normal;
    22 layout(location = 3) in uint obj_index;
     21layout(location = 2) in vec2 inTexCoord;
     22layout(location = 3) in vec3 vertex_normal;
     23layout(location = 4) in uint obj_index;
    2324
    2425layout(location = 0) out vec3 position_eye;
    2526layout(location = 1) out vec3 color;
    26 layout(location = 2) out vec3 normal_eye;
    27 layout(location = 3) out vec3 light_position_eye;
    28 layout(location = 4) out vec3 light2_position_eye;
     27layout(location = 2) out vec2 fragTexCoord;
     28layout(location = 3) out vec3 normal_eye;
     29layout(location = 4) out vec3 light_position_eye;
     30layout(location = 5) out vec3 light2_position_eye;
    2931
    3032// fixed point light position
     
    4042   color = (vertex_color * hp_percent) + (damage_color * (1.0 - hp_percent));
    4143
     44   fragTexCoord = inTexCoord;
     45
    4246   light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0));
    4347   light2_position_eye = vec3(ubo.view * vec4(light2_position_world, 1.0));
Note: See TracChangeset for help on using the changeset viewer.