• Stars
    star
    389
  • Rank 110,500 (Top 3 %)
  • Language
    C++
  • License
    Other
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CPU & GPU RTX based on OpenGL

1. 简介

这是我对 光线追踪 的练习,内容基于

  • Ray Tracing in One Weekend
  • Ray Tracing the Next Week
  • Ray Tracing the Rest of Your Life (暂时不写)

作者的源码网址

https://github.com/petershirley/raytracinginoneweekend

https://github.com/petershirley/raytracingthenextweek

https://github.com/petershirley/raytracingtherestofyourlife

对内容进行了大量的修改,优化,新增

详细内容参考 notes 和 源码

图形接口使用的是 OpenGL

近日正在着手 GPU的实现方案

2. 代码框架

/01_in_One_Weekend
  -01_01_Image
  -01_02_Camera
  -01_03_Sphere
  -01_04_Group
  -01_05_Material
  -01_06_Scene
/02_the_Next_Week
  -02_01_MotionBlur
  -02_02_AABB
  -02_03_Texture
  -02_04_Light
  -02_05_TriMesh
  -02_06_Transform
  -02_07_Volume
  -02_08_All
/03_GPU_RayTracing
	(只有3_9,3_10 和 3_11可以运行,如需运行03_01-03_08,需要回退版本)
  -03_01_Basic
  -03_02_RayTracingBasicSystem
  -03_03_Material
  -03_04_GenData
  -03_05_BVH_Node
  -03_06_ImgTexture
  -03_07_Light
  -03_08_TriMesh
  -03_09_Transform
  -03_10_Volume
  -03_11_All
/04_Extension
  -04_01_Skybox
  -04_02_Model
  -04_03_GPU_Skybox_Model
  -04_04_GPU_Loop
/Utility
  /OpenGL
    -Camera
    -FBO
    -gal
    -Glfw
    -Mesh
    -Model
    -Shader
    -Texture
    -VAO
  /Other
    -ArgManager
    -Config
    -EventManager
    -File
    -Header: Array2D, GStorage, LStorage, Pool, Ptr, RandSet, Singleton, Vec
    -HeapObj
    -Image
    -Math: Math, Perlin
    -Operation: Operation, LambdaOp, InfoLambdaOp, OpQueue
    -Shape: Shape, Cube, Sphere
    -Timer
  /RayTracing
    -Hitable: AABB, BVH_Node, Group, Hitable, MoveSphere, Sky, Sphere, Transform, Triangle, TriMesh, Volume
    -ImgWindow: ImgWindow, TexWindow
    -Material: Dielectric, Lambertian, Material, Metal, OpMaterial
    -RayCamera: Ray, RayCamera, TRay, TRayCamera
    -RT_Texture: ImgTexture, OpTexture(Const, Checker, Noise), Texture
    -Scene

2. 使用方法

2.1 环境

  • Visual Studio 2017+
  • Windows10
  • Git
  • CMake(版本2.8以上)

2.2 下载代码

git clone https://github.com/Ubpa/RayTracingToy

2.3 编译

  1. 建立工程
# 在 cmd 中运行如下命令
mkdir build
cd build
cmake .. -A Win32
  1. 打开 /build/RayTracingToy.sln
  2. 解决方案中CMakePredefinedTargets中,右键INSTALL,点击生成

2.4 配置

在运行exe前,可以对 config.out 进行修改来配置,在调试时在 config.in 进行修改来配置

3. 出图

01_06_Scene

01_in_a_Weekend_06_Scene

02_the_Next_Week_07_Volume

02_the_Next_Week_07_Volume

02_the_Next_Week_08_All

02_the_Next_Week_08_All

Glass Cube

02_the_Next_Week_08_All

04_03_GPU_Skybox_Model

04_Extension_03_GPU_Skybox_Model_post

04_04_GPU_Loop

04_Extension_04_GPU_Balance_post

More Repositories

1

RenderLab

App of RTR, PTR and Editor
C++
762
star
2

USRefl

Header-only, tiny (99 lines) and powerful C++20 static reflection library.
C++
646
star
3

Utopia

Utopia Game Engine 无境游戏引擎
C++
487
star
4

USTC_CG

00106501: Computer Graphics (Spring-Summer 2020)
C++
419
star
5

UECS

Ubpa Entity-Component-System (U ECS) in Unity3D-style
C++
369
star
6

UDRefl

Ubpa Dynamic Reflection
C++
353
star
7

UGM

Ubpa Graphics Mathematics
C++
320
star
8

GAMES102

GAMES 102
C++
273
star
9

CMU_15_462

notes and assignments of CG (CMU 15-462/662)
C++
91
star
10

UHEMesh

an elegant, high-performance and user-friendly halfedge data structure
C++
79
star
11

UFG

Ubpa Frame Graph
C++
44
star
12

UGraphviz

Ubpa Graphviz C++ wrapper
C++
38
star
13

ULuaPP

Ubpa Lua++ (Lua & C++)
C++
32
star
14

ExponentialHeightFog

[ Unreal to Unity ] Exponential Height Fog
HLSL
28
star
15

UDP

Ubpa Design Pattern
C++
27
star
16

USmallFlat

Ubpa small flat containers based on C++20
C++
27
star
17

UCMake

Ubpa CMake
CMake
23
star
18

UTemplate

C++
23
star
19

LearnOpenGL

OpenGL Exercise
C++
19
star
20

CG_LGLiu

exercises of CG class teached by Prof LiGang Liu in 2018
C++
19
star
21

UDXRenderer

Ubpa DirectX 12 Renderer
C++
18
star
22

RayTracingInOneWeekend

rewrite Ray Tracing in a Weekend
C++
16
star
23

UDLua

Ubpa Lua base on UDRefl
C++
16
star
24

Project-GAMES101

Project-GAMES101
15
star
25

UDX12

Ubpa DirectX 12 C++ Wrapper
C++
10
star
26

MasterCourses

Master Courses
C++
4
star
27

best-cpp-reflection

best cpp reflection
3
star
28

DoubleConeRain

Double Cone Rain
C#
3
star
29

UScene

Ubpa Scene
C++
3
star
30

LearnVulkan

Learn Vulkan
2
star
31

ULua

Ubpa Lua
CMake
2
star
32

LearnRust

Rust
2
star
33

UData

Ubpa Data
C
2
star
34

GAMES102_Data

GAMES_102_Data
2
star
35

RenderLab_bk_20200303

C++
2
star
36

UANTLR

Ubpa ANTLR4
ANTLR
1
star
37

UCommon

Ubpa Common
C++
1
star
38

USTL

Ubpa stl extension
C++
1
star
39

UGit

CMake
1
star
40

OSG_Exercise

C++
1
star
41

UContainer

Ubpa Container
C++
1
star
42

UEngine

Ubpa Engine
C++
1
star
43

UThreadPool

Ubpa Thread Pool
C++
1
star
44

LearnCompiler

Learn Compiler
ANTLR
1
star
45

SecretCode

Encrypt / Decode codes by DES and Base64
C++
1
star
46

UVisitor

Visitor
C++
1
star
47

LearnQt

C++
1
star
48

UANN

ANN (Approximate Nearest Neighbors) library, ported to CMake
C++
1
star