added more code to render my first scene; STILL WITH ERRORS

This commit is contained in:
2025-08-28 18:21:53 +02:00
parent 31c4b6708a
commit b24be88bdc
5 changed files with 111 additions and 29 deletions

View File

@ -0,0 +1,22 @@
#version 330 core
layout(location=0) in vec3 position;
layout(location=1) in vec3 normals;
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
//out vec3 fragPos;
//out vec3 fragNormal;
void main()
{
vec4 pos = vec4(position, 1.0);
// the inverse should be calculated on the CPU as it is quite expensive to run and doesn't need to be run for every vertex
// fragNormal = mat3(transpose(inverse(modelMatrix))) * normals;
// fragPos = vec3(modelMatrix * pos);
gl_Position = projectionMatrix * viewMatrix * modelMatrix * pos;
}