diff options
| author | 0undefined <oscar@nelin.dk> | 2025-11-10 23:17:37 +0000 |
|---|---|---|
| committer | 0undefined <oscar@nelin.dk> | 2025-11-10 23:17:37 +0000 |
| commit | b92c9d17efff6340dad64bd920900a130166ae11 (patch) | |
| tree | aa1642d1e7def80d09fb8c525ab9f4f0bc7fbaf2 /resources/shader.vert | |
| parent | 84c4c6466aaf15f16e0cb9f0470c93720805c355 (diff) | |
Add some lighting
Ambient & Diffuse, shadowmapping et. al. TBD
Diffstat (limited to 'resources/shader.vert')
| -rw-r--r-- | resources/shader.vert | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/resources/shader.vert b/resources/shader.vert index e5aff9a..50e8218 100644 --- a/resources/shader.vert +++ b/resources/shader.vert @@ -3,21 +3,20 @@ // Input vertex data, different for all executions of this shader. layout(location = 0) in vec3 vertexPosition_modelspace; layout(location = 1) in vec2 vertexUV; +layout(location = 2) in vec3 vNorm; out vec2 UV; +out vec3 FragmentPos; +out vec3 Normal; uniform mat4 MVP; +uniform mat4 modelPosition; void main() { gl_Position = MVP * vec4(vertexPosition_modelspace, 1); UV = vertexUV; - - //fragmentcolor.x = vertexPosition_modelspace.x; //= vertexColor; - //fragmentcolor.y = vertexPosition_modelspace.y; //= vertexColor; - //fragmentcolor.z = vertexPosition_modelspace.z; //= vertexColor; - - //fragmentcolor += 1; - //fragmentcolor /= 2; + FragmentPos = vec3(modelPosition * vec4(vertexPosition_modelspace,1)); + Normal = vNorm; } |
