feat: vertex colors
This commit is contained in:
@@ -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)) *
|
||||
|
||||
Reference in New Issue
Block a user