TinySnow / RayTracerSimplified

Try to implement a simple ray tracer. Source code has detailed comments and all the evolutions with git tag./尝试实现简单光线追踪器,源码带有注释,并且演进过程打上标签。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RayTracerSimplified

Description/概述

English:

Try to implement a simple ray tracer. Source code has detailed comments and all the evolutions with git tag.

Chinese:

尝试实现简单光线追踪器,源码带有注释,并且演进过程打上标签。

Evolutions/演进

English:

Details in commit message and tag message.

Chinese:

详情请看 commit message 和 tag message。

Summary/总结

English:

This source code only implemented:

  • Basics

    • Vector

    • Camera

    • Ray

  • Material

    • Lambertian

    • Dielectric

    • Metal

  • Geometry

    • Sphere
  • Depth of field(Defocus Blur)

This source code DIDN'T implement:

  • Volumetric fog

  • Geometry

    • Rectangle

    • Triangle

  • GPU acceleration

  • Light

    • Directional Light

    • Sky Light

    • Point Light

    • Spot Light

    • Rect Light

  • File input(e.g. Blender file)

  • etc

Chinese:

此仓库源码只实现了:

  • 基础

    • 向量

    • 光线

    • 摄像机

  • 材质

    • 漫反射

    • 玻璃

    • 金属

  • 几何体

    • 球体
  • 景深(散焦模糊)

此仓库代码没有实现:

  • 体积光

  • 几何体

    • 矩形体

    • 三角体

  • GPU 加速

  • 光线

    • 定向光源

    • 天空光照

    • 点光源

    • 聚光源

    • 矩形光源

  • 文件输入(例:Blender 文件)

  • 等等

Results/成果

Final Scene/最终场景

image_final_scene_show_A

image_final_scene_show_B

image_final_scene_show_C

image_final_scene_show_D

image_final_scene_show_E

image_final_scene_show_F

Control Variables/控制变量

Main Variables/主要变量

English:

In the file name, value of variables are commented. Ray numbers per pixel and max scattering numbers per ray.

Note: Scattering includes reflection and refraction。

Chinese:

在文件名中,变量值已标注。Ray 为每像素发出的光线数量,Scatter 为每光线的最大散射次数。

注意:散射包括反射和折射。

Pictures/图片

image_final_scene_1_rays_1_scatters

image_final_scene_1_rays_2_scatters

image_final_scene_1_rays_3_scatters

image_final_scene_1_rays_4_scatters

image_final_scene_1_rays_5_scatters

image_final_scene_1_rays_10_scatters

image_final_scene_1_rays_25_scatters

image_final_scene_1_rays_50_scatters

image_final_scene_5_rays_1_scatters

image_final_scene_5_rays_2_scatters

image_final_scene_5_rays_5_scatters

image_final_scene_10_rays_5_scatters

image_final_scene_test_100_rays

image_final_scene_test_500_rays

Other Variables/其他变量

English:

Includes aperture, fov(field of view, based on height calculating), distance to focus.

Chinese:

包括 aperture(光圈大小),fov(field of view,视野大小,基于高度计算),distance to focus(焦距)。

Pictures/图片

image_final_scene_another_5_rays_5_scatters

image_final_scene_another_50_rays_10_scatters

Following picture based: image_final_scene_another_10_rays_10_scatters

image_final_scene_another_10_rays_10_scatters_no_aperture

image_final_scene_another_10_rays_10_scatters_normal(0.1)_aperture

image_final_scene_another_10_rays_10_scatters_big(0.5)_aperture

image_final_scene_another_10_rays_10_scatters_huge(1.0)_aperture

image_final_scene_another_10_rays_10_scatters_short(4)_focus

image_final_scene_another_10_rays_10_scatters_long(50)_focus

image_final_scene_another_10_rays_10_scatters_no_fov

image_final_scene_another_10_rays_10_scatters_tiny(5)_fov

image_final_scene_another_10_rays_10_scatters_little(10)_fov

image_final_scene_another_10_rays_10_scatters_normal(30)_fov

image_final_scene_another_10_rays_10_scatters_huge(90)_fov

Evolutions Pictures/演进过程渲染图

image_v0.1.0_hello_world(初始化图片)

image_v0.2.0_vector_model_added(添加向量模型)

image_v0.3.0_rays_and_camera_added(添加光线和摄像机类)

image_v0.4.0_multiobjects_can_be_rendered(可以渲染多个物体)

image_v0.4.1_antialiasing_added(添加抗锯齿)

image_v0.4.2_diffuse_added(添加漫反射)

image_v0.4.3_material_added(添加材质)

image_v0.4.4_gamma_corrected(进行伽马矫正)

image_v0.5.0_probability_of_refraction_added(添加折射发生概率)

image_v0.5.1_custom_wide-angle_lens_added(添加自定义镜头角度摄像机)

image_v0.5.1_depth_of_field(添加景深)

image_v0.5.2_custom_camera_position_added(摄像机可自定义位置)

image_v0.5.2_camera_position_changed_A

image_v0.5.2_camera_position_changed_B

Reference/参考

Ray Tracing in One Weekend

Ray Tracing in One Weekend (Chinese version translated by Oxine)

Unreal Engine Docs -> RayTracing (in Chinese)

Physically Based Rendering: From Theory to Implementation

License/许可证

MIT License.

About

Try to implement a simple ray tracer. Source code has detailed comments and all the evolutions with git tag./尝试实现简单光线追踪器,源码带有注释,并且演进过程打上标签。

License:MIT License


Languages

Language:C++ 97.0%Language:CMake 2.0%Language:C 1.0%