feat: improved construction times
This commit is contained in:
20
renderer.hpp
20
renderer.hpp
@@ -72,14 +72,14 @@ class Renderer {
|
||||
|
||||
int startX = std::max<int>(
|
||||
(testP.bounding[0] * invWidthScale).i >> SHIFT_AMOUNT, 0);
|
||||
int endX =
|
||||
std::min<int>((testP.bounding[1] * invWidthScale).i >> SHIFT_AMOUNT,(uint32_t)
|
||||
target->width - 1);
|
||||
int endX = std::min<int>((testP.bounding[1] * invWidthScale).i >>
|
||||
SHIFT_AMOUNT,
|
||||
(uint32_t)target->width - 1);
|
||||
int startY = std::max<int>(
|
||||
(testP.bounding[2] * invHeightScale).i >> SHIFT_AMOUNT, 0);
|
||||
int endY =
|
||||
std::min<int>((testP.bounding[3] * invHeightScale).i >> SHIFT_AMOUNT,
|
||||
target->height - 1);
|
||||
int endY = std::min<int>((testP.bounding[3] * invHeightScale).i >>
|
||||
SHIFT_AMOUNT,
|
||||
target->height - 1);
|
||||
|
||||
vec3 pos = vec3(testP.bounding[0], testP.bounding[2], 0.0);
|
||||
for (int x = startX; x < endX; x++) {
|
||||
@@ -96,13 +96,15 @@ class Renderer {
|
||||
decimal lightFac =
|
||||
std::max(normal * (-sunDir), decimal(0.0)) +
|
||||
decimal(0.5);
|
||||
// decimal reflection = target->setDepth(x, y,
|
||||
// depth);
|
||||
;
|
||||
target->setDepth(x, y, depth);
|
||||
target->set(x, y,
|
||||
(color * decimal(120.0)) * lightFac);
|
||||
|
||||
// target->set(x, y,
|
||||
// (normals + vec3(1.0, 1.0, 1.0)) *
|
||||
// vec3(lightFac * decimal(200.0), 0, 0));
|
||||
// target->set(x, y,
|
||||
// (normal + vec3(1.0, 1.0, 1.0)) *
|
||||
// decimal(120.0));
|
||||
// target->set(x, y, factors * decimal(200.0));
|
||||
// if (!factors.isSmall())
|
||||
|
||||
Reference in New Issue
Block a user