Changeset a00eb06 in opengl-game for shaders/model.vert
- Timestamp:
- Apr 10, 2021, 12:58:17 AM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 8d92284
- Parents:
- 914bb99
- git-author:
- Dmitry Portnoy <dportnoy@…> (04/10/21 00:49:42)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (04/10/21 00:58:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/model.vert
r914bb99 ra00eb06 15 15 } sbo; 16 16 17 layout (binding = 2) uniform UboInstance { 18 mat4 model; 19 } uboInstance; 20 17 21 layout(location = 0) in vec3 inPosition; 18 22 layout(location = 1) in vec3 inColor; 19 23 layout(location = 2) in vec2 inTexCoord; 20 layout(location = 3) in uint obj_index; 24 layout(location = 3) in vec3 vertex_normal; 25 layout(location = 4) in uint obj_index; 21 26 22 27 layout(location = 0) out vec3 fragColor; 23 28 layout(location = 1) out vec2 fragTexCoord; 29 layout(location = 2) out vec3 normal_eye; 24 30 25 31 void main() { 32 // Using 0.0 instead of 1.0 means translations won't effect the normal 33 normal_eye = normalize(vec3(ubo.view * sbo.objects[obj_index].model * vec4(vertex_normal, 0.0))); 34 26 35 fragColor = inColor; 27 36 fragTexCoord = inTexCoord;
Note:
See TracChangeset
for help on using the changeset viewer.