feat: light rendering

This commit is contained in:
2025-10-08 18:36:46 +02:00
parent fefe273fce
commit 42d5def07e
2 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,8 @@ void Renderer::Render(entt::registry& registry) {
return;
}
m_shader.setBool("isLight", registry.all_of<light>(entity));
m_model = glm::mat4(1.0f);
// Apply translation

View File

@ -27,6 +27,8 @@ uniform float opacity;
uniform sampler2D diffuseTex;
uniform bool useTexture;
uniform bool isLight;
#define LIGHT_COLOR vec3(1.0, 1.0, 1.0)
void main()
@ -57,5 +59,11 @@ void main()
vec3 result = (ambient + diffuse + specular) * texColor;
if (isLight) {
vec3 emissive = LIGHT_COLOR * 10.0; // big intensity
FragColor = vec4(emissive, 1.0);
return;
}
FragColor = vec4(result, opacity);
}