This PR is related to #41 for introducing another rendering pipeline for ray traced rendering and bring to realism of rendering to the next level. The current plan is to render water effect with ray tracing, but can be easily extended for other stuff like ambient occlusion and shadow in the future.
Unfortunately the current state of this new framework is considered to be unused, unstable and untested because the amount of work to be done have been greatly underestimated. I decide to make a release on an incomplete feature since this task is hugely over-scheduled and my TODO list for other tasks is building up, and there are a few critical refactoring and bug fix patches that I want to make them available to the master branch ASAP. Therefore this feature will be split into 2 separate releases, the next major release will take care of integration of ray tracing framework into the current rendering system.
TL;DR There is no change to the rendering quality in this release, but a few refactoring, optimisation and fixes to the API, other than a new (and probably broken) framework.
STPExtendedScenePipeline
This is where the majority of the works take place, consist of a memory manager for managing the top-level AS build, and a renderer. All the renderer does is to launch a ray in given direction and find the intersection to the scene, essentially a ray caster rather than ray tracer as advertised.
The output will be the ray tracing G-Buffer containing ID of intersecting geometry (of missed for sky shading), as well as position and texture coordinate of the geometry. These data will be passed to the traditional renderers and process them into G-Buffer usable by the deferred shader.
Future works
The main goal for the next release is integration of ray tracing framework, this involves a few changes:
STPHeightfieldTerrain rendering class should manage a separate geometry and AS build for the terrain mesh.
Also the terrain renderer, needs to convert from the ray tracing G-buffer to rasterisation G-Buffer, i.e., convert position and UV to albedo, normal, roughness, etc.. They can be all done based on the current fragment shader.
All environment renderers should compute pixels for missed rays, and it should be easy enough to replace the input skybox ray direction by the ray direction from the ray tracer.
Integrate STPExtendedScenePipeline into STPScenePipeline, which is a lot of works.
Might need some further refactoring for some of those features.
These are essential major fixes and improvements when implementing the framework. For minor changes consult release notes 0.15.0-preview.x where x = 1,2,3.
[x] Split the old NVRTC helper class into 2 stateless models, a NVRTC compiled binary and CUDA driver API managed module.
[x] Refactor CUDA API error handler and fix a UB.
[x] Refactor the abstract rendering components such as adding a new STPAnimatedObject and merging shadow and non-shadow variant for STPSceneObject.
[x] Improve thread pool for more robust task completion on destruction.
[x] GL API compatibility header refactor and add more types.
[x] Misc changes as mentioned in the preview release notes.
This PR is related to #41 for introducing another rendering pipeline for ray traced rendering and bring to realism of rendering to the next level. The current plan is to render water effect with ray tracing, but can be easily extended for other stuff like ambient occlusion and shadow in the future.
Unfortunately the current state of this new framework is considered to be unused, unstable and untested because the amount of work to be done have been greatly underestimated. I decide to make a release on an incomplete feature since this task is hugely over-scheduled and my TODO list for other tasks is building up, and there are a few critical refactoring and bug fix patches that I want to make them available to the master branch ASAP. Therefore this feature will be split into 2 separate releases, the next major release will take care of integration of ray tracing framework into the current rendering system.
TL;DR There is no change to the rendering quality in this release, but a few refactoring, optimisation and fixes to the API, other than a new (and probably broken) framework.
STPExtendedScenePipeline
This is where the majority of the works take place, consist of a memory manager for managing the top-level AS build, and a renderer. All the renderer does is to launch a ray in given direction and find the intersection to the scene, essentially a ray caster rather than ray tracer as advertised.
The output will be the ray tracing G-Buffer containing ID of intersecting geometry (of missed for sky shading), as well as position and texture coordinate of the geometry. These data will be passed to the traditional renderers and process them into G-Buffer usable by the deferred shader.
Future works
The main goal for the next release is integration of ray tracing framework, this involves a few changes:
STPHeightfieldTerrain
rendering class should manage a separate geometry and AS build for the terrain mesh.All environment renderers should compute pixels for missed rays, and it should be easy enough to replace the input skybox ray direction by the ray direction from the ray tracer.
Integrate
STPExtendedScenePipeline
intoSTPScenePipeline
, which is a lot of works.Might need some further refactoring for some of those features.
Summary
Framework
[x] Setup rendering environment with OptiX.
[x] Implement
STPExtendedScenePipeline
.[x] Add
STPExtendedSceneObject::STPTraceable
.[x] Implement
STPScreenSpaceRayIntersection
shader.Other
These are essential major fixes and improvements when implementing the framework. For minor changes consult release notes 0.15.0-preview.x where x = 1,2,3.
[x] Split the old NVRTC helper class into 2 stateless models, a NVRTC compiled binary and CUDA driver API managed module.
[x] Refactor CUDA API error handler and fix a UB.
[x] Refactor the abstract rendering components such as adding a new
STPAnimatedObject
and merging shadow and non-shadow variant forSTPSceneObject
.[x] Improve thread pool for more robust task completion on destruction.
[x] GL API compatibility header refactor and add more types.
[x] Misc changes as mentioned in the preview release notes.