stephen-hqxu / superterrainplus

SuperTerrain+: A real-time procedural 3D infinite terrain engine with geographical features and photorealistic rendering.
MIT License
12 stars 1 forks source link

Framework for Ray Tracing #50

Closed stephen-hqxu closed 2 years ago

stephen-hqxu commented 2 years ago

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: