added a shitty ecs that I'm confident is way worse than just looping … (#4)

* added a shitty ecs that I'm confident is way worse than just looping objects lol

* mader a rendering system based on ecs
This commit is contained in:
Heaust Azure
2025-05-06 18:53:21 +05:30
committed by GitHub
parent 5ecaf14b3d
commit 9d2bf4055d
17 changed files with 549 additions and 233 deletions
+16
View File
@@ -0,0 +1,16 @@
#version 300 es
precision highp float;
in vec3 vNormal;
out vec4 fragColor;
void main() {
vec3 normal = normalize(vNormal);
vec3 lightDir = normalize(vec3(0.0, 0.0, 1.0));
float diff = max(dot(normal, lightDir), 0.0);
vec3 diffuseColor = vec3(1.0, 0.5, 0.3) * diff;
fragColor = vec4(diffuseColor, 1.0);
}
+20
View File
@@ -0,0 +1,20 @@
#version 300 es
precision highp float;
in vec3 attr_pos;
in vec3 attr_normals;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 vNormal;
void main() {
mat3 normalMatrix = transpose(inverse(mat3(model)));
vNormal = normalize(normalMatrix * attr_normals);
gl_Position = projection * view * model * vec4(attr_pos, 1.0);
}