diff --git a/examples/raytracer.psl b/examples/raytracer.psl index 433a09b..cb33077 100644 --- a/examples/raytracer.psl +++ b/examples/raytracer.psl @@ -209,25 +209,17 @@ func log(x: f32) -> f32: return logf(x) func abs(x: f32) -> f32: - if x < 0.0: - return -x - return x + return if x >= 0.0 then x else -x func min(x: f32, y: f32) -> f32: - if x < y: - return x - return y + return if x <= y then x else y func max(x: f32, y: f32) -> f32: - if x > y: - return x - return y + return if x >= y then x else y // I want function overloading so badly func min_u32(x: u32, y: u32) -> u32: - if x < y: - return x - return y + return if x <= y then x else y func clamp(x: f32) -> f32: return max(0.0, min(1.0, x)) @@ -767,19 +759,19 @@ const default_fovy = 2.0 * atan(0.5) func main(): let scene = make_default_scene() - // let image = create_image(512ul, 512ul) + let image = create_image(512ul, 512ul) // let image = create_image(256ul, 256ul) - let image = create_image(128ul, 128ul) + // let image = create_image(128ul, 128ul) let aspect_ratio = (image.width as f32) / (image.height as f32) let camera = camera(vec3(0.0, 0.0, 15.0), identity, default_fovy, compute_fovx(default_fovy, aspect_ratio)) // const samples_per_pixel = 16384ul - // const samples_per_pixel = 4096ul + const samples_per_pixel = 4096ul // const samples_per_pixel = 2048ul // const samples_per_pixel = 1024ul // const samples_per_pixel = 512ul - const samples_per_pixel = 256ul + // const samples_per_pixel = 256ul // const samples_per_pixel = 16ul // const samples_per_pixel = 1ul