tweak lights to make scene more interesting

This commit is contained in:
dvdrw 2023-12-03 21:56:53 +01:00
parent 3827be61ac
commit 294cd72ee7
Signed by: dvdrw
GPG Key ID: 4756FA53D8797D7F

View File

@ -11,8 +11,8 @@
#include <algorithm> #include <algorithm>
static std::vector<Renderable*> lights { static std::vector<Renderable*> lights {
new Light(v3{0, 0, 19}, 2, v3{1, 1, 1}), new Light(v3{0, 0, 19}, 2, v3{2, 1, 1}),
new Light(v3{-7, 15, 0}, 2, v3{1, 1, 1}), new Light(v3{-7, 15, 0}, 2, v3{1, 2, 2}),
new Light(v3{17, -9, 16}, 2, v3{1, 1, 1}), new Light(v3{17, -9, 16}, 2, v3{1, 1, 1}),
// new Light(v3{0, 0, 19}, 2, v3{0.8, 0.8, 0.9}), // new Light(v3{0, 0, 19}, 2, v3{0.8, 0.8, 0.9}),
@ -22,17 +22,17 @@ static std::vector<Renderable*> lights {
static const Material PLANE_MAT = { static const Material PLANE_MAT = {
.specular = 0.12, .specular = 0.12,
.roughness = 0.55, .roughness = 0.75,
.ior = 2, .ior = 2,
.transparency = 0, .transparency = 0,
.colour = {1, 1, 1}, .colour = {1, 0, 1},
}; };
static const Material SPHERE_MAT_TRANS = { static const Material SPHERE_MAT_TRANS = {
.specular = 0.85, .specular = 0.85,
.roughness = 0.5, .roughness = 0.5,
.ior = 1.2, .ior = 1.2,
.transparency = 0.95, .transparency = 0.75,
.colour = {0, 1, 0}, .colour = {0, 1, 0},
}; };
@ -60,8 +60,6 @@ static std::vector<Renderable*> objects
static std::vector<Renderable*> scene; static std::vector<Renderable*> scene;
// static constexpr int W = 294*2, H = 82*2;
// static constexpr int W = 2 * 640 * 2.9 * 1.8, H = 2 * 480 * 1.5 * 2.5;
static constexpr int W = 2*80, H = 2*24; static constexpr int W = 2*80, H = 2*24;
static constexpr choice_t ASPECT_RATIO = W/(H * 1.9); static constexpr choice_t ASPECT_RATIO = W/(H * 1.9);
@ -152,7 +150,8 @@ int main()
camera.zoom /= 1.015; camera.zoom /= 1.015;
break; break;
case 'p': case 'p':
printf("pos: " V3_FMT "\nrot: " V3_FMT, V3_ARG(camera.pos), V3_ARG(camera.rotation)); printf("pos: " V3_FMT, V3_ARG(camera.pos));
printf("\nrot: " V3_FMT, V3_ARG(camera.rotation));
break; break;
case '\n': case '\n':
case 'q': case 'q':