fix: Remaining scanlines, not completed
I forgot I reversed the range. Didn't notice until I tried out a 1920x1080 render and realized it was counting *up* when it said "remainding."
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -29,14 +29,14 @@ fn main() {
|
|||||||
(400.0 / aspect_ratio) as i32
|
(400.0 / aspect_ratio) as i32
|
||||||
);
|
);
|
||||||
let samples_per_pixel = 100;
|
let samples_per_pixel = 100;
|
||||||
let max_depth = 100;
|
let max_depth = 50;
|
||||||
|
|
||||||
// world
|
// world
|
||||||
|
|
||||||
let mat_ground = Material::Lambertian{ albedo: Vec3::new(0.8, 0.8, 0.0) };
|
let mat_ground = Material::Lambertian{ albedo: Vec3::new(0.8, 0.8, 0.0) };
|
||||||
let mat_center = Material::Lambertian{ albedo: Vec3::new(0.7, 0.3, 0.3) };
|
let mat_center = Material::Lambertian{ albedo: Vec3::new(0.7, 0.3, 0.3) };
|
||||||
let mat_left = Material::Metal{ albedo: Vec3::new(0.8, 0.8, 0.8) };
|
let mat_left = Material::Metal{ albedo: Vec3::new(0.8, 0.8, 0.8), fuzz: 0.3 };
|
||||||
let mat_right = Material::Metal{ albedo: Vec3::new(0.8, 0.6, 0.2) };
|
let mat_right = Material::Metal{ albedo: Vec3::new(0.8, 0.6, 0.2), fuzz: 1.0 };
|
||||||
|
|
||||||
let mut world = HittableList::new();
|
let mut world = HittableList::new();
|
||||||
world.add(
|
world.add(
|
||||||
@@ -64,8 +64,7 @@ fn main() {
|
|||||||
Sphere{
|
Sphere{
|
||||||
center: Vec3::new(-1.0, 0.0, -1.0),
|
center: Vec3::new(-1.0, 0.0, -1.0),
|
||||||
radius: 0.5,
|
radius: 0.5,
|
||||||
material: Some(mat_left),
|
material: Some(mat_left), }
|
||||||
}
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -88,7 +87,7 @@ fn main() {
|
|||||||
let distrib = Uniform::new(0.0, 1.0);
|
let distrib = Uniform::new(0.0, 1.0);
|
||||||
println!("P3\n{} {}\n255", image.0, image.1);
|
println!("P3\n{} {}\n255", image.0, image.1);
|
||||||
for y in (0..image.1).rev() {
|
for y in (0..image.1).rev() {
|
||||||
eprintln!("Scanlines remaining: {}", image.1 - y);
|
eprintln!("Scanlines remaining: {}", y);
|
||||||
for x in 0..image.0 {
|
for x in 0..image.0 {
|
||||||
let mut color = Vec3::zero();
|
let mut color = Vec3::zero();
|
||||||
for _ in 0..samples_per_pixel {
|
for _ in 0..samples_per_pixel {
|
||||||
|
|||||||
Reference in New Issue
Block a user