diff options
Diffstat (limited to 'shaders/final.vertex')
| -rw-r--r-- | shaders/final.vertex | 8 |
1 files changed, 2 insertions, 6 deletions
| diff --git a/shaders/final.vertex b/shaders/final.vertex index 4c5b1d5..ed6079f 100644 --- a/shaders/final.vertex +++ b/shaders/final.vertex | |||
| @@ -8,12 +8,11 @@ out vec2 UV; | |||
| 8 | out vec3 normIn; | 8 | out vec3 normIn; |
| 9 | out vec3 camDirIn; | 9 | out vec3 camDirIn; |
| 10 | out vec3 lightDirIn; | 10 | out vec3 lightDirIn; |
| 11 | //out vec3 vertPos; | ||
| 12 | 11 | ||
| 13 | uniform mat4 MVP; | 12 | uniform mat4 MVP; |
| 14 | uniform mat4 worldMat; | 13 | uniform mat4 worldMat; |
| 15 | 14 | ||
| 16 | const vec3 Tuning_LightPos = vec3(1, 1, -1.0); | 15 | const vec3 Tuning_LightPos = vec3(2, 1, -1); |
| 17 | 16 | ||
| 18 | void main() | 17 | void main() |
| 19 | { | 18 | { |
| @@ -22,11 +21,8 @@ void main() | |||
| 22 | normIn = vertexNormal; | 21 | normIn = vertexNormal; |
| 23 | 22 | ||
| 24 | mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); | 23 | mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); |
| 25 | //mat3 invWorldRot = mat3(1.0f); | ||
| 26 | vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; | 24 | vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; |
| 25 | |||
| 27 | camDirIn = invWorldRot * (vec3(2,0,0) - worldPos); | 26 | camDirIn = invWorldRot * (vec3(2,0,0) - worldPos); |
| 28 | //camDir = worldPos; | ||
| 29 | lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); | 27 | lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); |
| 30 | //vec4 vertPos4 = vec4(vertexPosition_modelspace,1); | ||
| 31 | //vertPos = vec3(vertPos4) / vertPos4.w; | ||
| 32 | } | 28 | } |
