- Timestamp:
- Apr 10, 2021, 1:31:20 AM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- b8efa56
- Parents:
- a00eb06
- Location:
- shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/ship.frag
ra00eb06 r8d92284 4 4 layout(location = 0) in vec3 position_eye; 5 5 layout(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; 6 layout(location = 2) in vec2 fragTexCoord; 7 layout(location = 3) in vec3 normal_eye; 8 layout(location = 4) in vec3 light_position_eye; 9 layout(location = 5) in vec3 light2_position_eye; 9 10 10 11 layout(location = 0) out vec4 frag_color; … … 55 56 56 57 // specular intensity 57 vec3 Is2 = Ls * Ks * specular_factor2 ;58 vec3 Is2 = Ls * Ks * specular_factor2 + vec3(fragTexCoord, 0.0) - vec3(fragTexCoord, 0.0); 58 59 59 60 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2) / 2.0, 1.0); -
shaders/ship.vert
ra00eb06 r8d92284 17 17 layout(location = 0) in vec3 vertex_position; 18 18 layout(location = 1) in vec3 vertex_color; 19 layout(location = 2) in vec3 vertex_normal; 20 layout(location = 3) in uint obj_index; 19 layout(location = 2) in vec2 inTexCoord; 20 layout(location = 3) in vec3 vertex_normal; 21 layout(location = 4) in uint obj_index; 21 22 22 23 layout(location = 0) out vec3 position_eye; 23 24 layout(location = 1) out vec3 color; 24 layout(location = 2) out vec3 normal_eye; 25 layout(location = 3) out vec3 light_position_eye; 26 layout(location = 4) out vec3 light2_position_eye; 25 layout(location = 2) out vec2 fragTexCoord; 26 layout(location = 3) out vec3 normal_eye; 27 layout(location = 4) out vec3 light_position_eye; 28 layout(location = 5) out vec3 light2_position_eye; 27 29 28 30 // fixed point light positions … … 40 42 color = vertex_color; 41 43 44 fragTexCoord = inTexCoord; 45 42 46 light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0)); 43 47 light2_position_eye = vec3(ubo.view * vec4(light2_position_world, 1.0));
Note:
See TracChangeset
for help on using the changeset viewer.