rustracer:基于“一个周末的射线跟踪”系列的防锈射线跟踪器

  • H6_635106
    了解作者
  • 3.4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-26 09:25
    上传日期
Rustracer-写在Rust中的路径追踪器 这是用锈写的基本光线/路径追踪器。 它基于Peter Shirley撰写的《一个周末的光线追踪》一书, 。 此回购一直贯穿到第二本书,但已删除了移动球体。 用法 cargo run --release --example main 表演 本节基于该系列的第一本书,并且仅适用于v1.1.1标记。 v1.1.1(多线程): 添加了对多线程的支持后,rustrace现在变得超级快。 基准测试: 电脑资讯: macOS 10.14.3(18D109) MacBook Pro(15英寸,2018年) 2.6 GHz英特尔酷睿i7 16 GB 2400 MHz DDR4 Rustracer: 花了19.57秒。 使用cargo run --release > image.ppm (以上时间减去0.86s生成时间) 参考: 花
rustracer-master.zip
  • rustracer-master
  • .gitignore
    84B
  • denoise.bash
    374B
  • src
  • geometry
  • translation.rs
    5.5KB
  • mod.rs
    200B
  • constant_medium.rs
    1.7KB
  • rect.rs
    3.7KB
  • sphere.rs
    2.3KB
  • cuboid.rs
    2.8KB
  • utils.rs
    920B
  • tracer
  • vec3.rs
    6.7KB
  • mod.rs
    245B
  • ray.rs
    235B
  • camera.rs
    1.7KB
  • render.rs
    4.4KB
  • bvh.rs
    4.4KB
  • scene.rs
    456B
  • bounding_box.rs
    1.3KB
  • hitable.rs
    1.4KB
  • material.rs
    5.3KB
  • texture
  • image_texture.rs
    797B
  • constant_texture.rs
    520B
  • checker_texture.rs
    583B
  • mod.rs
    224B
  • noise_texture.rs
    3.7KB
  • texture.rs
    800B
  • animation.rs
    1.7KB
  • lib.rs
    143B
  • Cargo.lock
    26.3KB
  • Cargo.toml
    227B
  • earthmap.jpg
    2.5MB
  • examples
  • cornell_box.rs
    2.8KB
  • cornell_smoke.rs
    3.1KB
  • ray_tracing_the_next_week.rs
    3.9KB
  • ghostly_orbs.rs
    5.2KB
  • earth.rs
    1.7KB
  • two_perlin_spheres.rs
    1.3KB
  • simple_light.rs
    1.8KB
  • moon_orbits_earth.rs
    2.3KB
  • random_spheres.rs
    4.1KB
  • rttnw_final_scene.png
    984KB
  • README.md
    1.8KB
内容介绍
# Rustracer - A Path Tracer Written In Rust <p align="center"> </p> This is a basic ray / path tracer written in rust. It is based off of the book *Ray Tracing in One Weekend* by Peter Shirley, [available here](https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-ebook/dp/B01B5AODD8/ref=sr_1_1?crid=2M1LIGDUSI1DY&keywords=ray+tracing+in+one+weekend&qid=1554232233&s=gateway&sprefix=ray+tracing+in+%2Caps%2C209&sr=8-1). This repo follows all the way through book two, with the exception that moving spheres were removed. ## Usage ```bash cargo run --release --example main ``` ## Performace This section is based off the first book in the series and applies to the v1.1.1 tag only. **v1.1.1 (Multi Threaded):** After adding support for multi-threading, rustrace is now super *duper* fast. Benchmarks: Computer Info: - macOS 10.14.3 (18D109) - MacBook Pro (15-inch, 2018) - 2.6 GHz Intel Core i7 - 16 GB 2400 MHz DDR4 Rustracer: - Took 19.57 seconds. - Run using `cargo run --release > image.ppm` (Time above subtracts 0.86s build time) Reference: - Took 58.051 seconds. - Built using `g++ -O3 main.cc -o main` This is an unfair comparison now though because the reference implementation is single threaded. **v1.0.0 (Single Threaded):** Interestingly this implementation is slightly faster than the [C++ reference version](https://github.com/petershirley/raytracinginoneweekend). By slightly I mean *very* slightly, they are within seconds of each other. Benchmarks: Computer Info: - macOS 10.14.3 (18D109) - MacBook Pro (15-inch, 2018) - 2.6 GHz Intel Core i7 - 16 GB 2400 MHz DDR4 Rustracer: - Took 56.091 seconds. - Run using `cargo run --release > image.ppm` (Time above subtracts 0.79s build time) Reference: - Took 58.051 seconds. - Built using `g++ -O3 main.cc -o main` Both programs are single threaded.
评论
    相关推荐