feat: vertex colors

This commit is contained in:
2025-11-29 10:07:59 +01:00
parent 0c94bf1df2
commit efbde487cc
5 changed files with 15 additions and 6 deletions

View File

@@ -78,17 +78,17 @@ class Renderer {
decimal depth = testP.calcDepth(factors);
if (depth < target->getDepth(x, y)) {
// std::cout << factors << std::endl;
vec3 normals = testP.calcNormal(factors);
vec3 normal = testP.calcNormal(factors);
vec3 color = testP.calcColor(factors);
decimal lightFac =
std::max(
normals *
normal *
(-vec3(1.0, -1.0, 1.0).normalize()),
decimal(0.0)) +
decimal(0.5);
target->setDepth(x, y, depth);
target->set(x, y,
(lightFac * vec3(1., 1., 1.)) *
decimal(120.0));
(color * decimal(120.0)) * lightFac);
// target->set(x, y,
// (normals + vec3(1.0, 1.0, 1.0)) *