The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
|
A Delta Radiance Field renderer for augmented reality. More...
Public Member Functions | |
void | update_tracked_scene (ID3D11DeviceContext *context) |
Update all objects (synthetic and real reconstructed scene) with a matrix from the tracker. | |
void | update_frame (ID3D11DeviceContext *context, double time, float elapsed_time) |
Update function for everything called once a frame. | |
void | reload_shader (ID3D11Device *device, ID3D11DeviceContext *context) |
A function called if the shaders should be reloaded. | |
virtual void | save (dune::serializer &s) |
Saves dune objects used in the common_renderer. Overload to add more. | |
virtual void | load (ID3D11DeviceContext *context, const dune::serializer &s) |
Load dune objects used in the common_renderer. Overload to add more. | |
Public Member Functions inherited from dc::rsm_renderer< dune::differential_directional_light > | |
void | update_light_parameters (ID3D11DeviceContext *context, dune::directional_light &l) |
Update and upload parameters (view projection matrix, flux etc.) of a directional light. | |
Public Member Functions inherited from dc::common_renderer | |
virtual void | resize (UINT width, UINT height) |
Resize the deferred_renderer's output to a new width/height . | |
virtual void | update_postprocessing_parameters (ID3D11DeviceContext *context) |
Upload postprocessing paraemters from the postporcessing pipeline. | |
virtual void | update_camera (ID3D11DeviceContext *context, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
Update function called for the camera. | |
void | set_shader (ID3D11Device *device, ID3DBlob *input_binary, ID3D11VertexShader *vs_deferred, ID3D11PixelShader *ps_deferred, ID3D11PixelShader *ps_overlay, UINT start_slot, UINT overlay_slot, UINT postprocessing_slot) |
Set deferred rendering shaders. More... | |
Public Member Functions inherited from dune::deferred_renderer | |
void | start_capture (ID3D11Device *device, size_t width, size_t height, size_t fps) |
Capture the backbuffer and write it to an MP4 video file. More... | |
void | stop_capture () |
Stop capturing and finalize an MP4 video file. | |
const buffer_collection & | buffers () |
Returns the map containing all buffers indexed by their registers. | |
void | add_buffer (gbuffer &buffer, UINT slot) |
Add a gbuffer to the deferred renderer buffer map. More... | |
void | add_buffer (texture &target, UINT slot) |
Add a render_target to the buffer map. | |
void | set_postprocessor (postprocessor *pp) |
Set a postprocessor to use. If this isn't called or set to nullptr, the deferred renderer output is displayed directly. | |
void | show_target (ID3D11DeviceContext *context, const tstring &name) |
Select a render_target by name to display in a small overlay when rendering. | |
Protected Member Functions | |
void | render_drf (ID3D11DeviceContext *context, float *clear_color) |
Renders a Delta Radiance Field. | |
void | render_gi (ID3D11DeviceContext *context, float *clear_color) |
Compute global illumination for the scene. More... | |
virtual void | do_render_scene (ID3D11DeviceContext *context) |
Derived classes can overload this method to call render() on more dune objects. Buffers etc. are all set up already. | |
virtual void | do_render_rsm (ID3D11DeviceContext *context) |
Virtual function to render more stuff for the RSM. | |
Protected Member Functions inherited from dc::rsm_renderer< dune::differential_directional_light > | |
void | update_rsm_camera_parameters (ID3D11DeviceContext *context, dune::directional_light &l) |
Update and upload RSM camera parameters (i.e. light view projection matrix etc.). | |
void | render_rsm (ID3D11DeviceContext *context, float *clear_color, dune::gbuffer &rsm) |
Render a scene from a directional_light position into an RSM. | |
Protected Member Functions inherited from dc::common_renderer | |
void | reset_omrtv (ID3D11DeviceContext *context) |
Resets all render target views to nullptr. | |
void | update_bbox (ID3D11DeviceContext *context, dune::d3d_mesh &mesh) |
Upload the bounding box of a mesh to the pixel shader. | |
void | update_camera_parameters (ID3D11DeviceContext *context) |
Upload camera parameters to the respective shaders. | |
void | update_scene (ID3D11DeviceContext *context, const DirectX::XMMATRIX &world) |
Update the scene with a new model matrix to move/scale/... stuff. | |
void | update_onetime_parameters (ID3D11DeviceContext *context, dune::d3d_mesh &mesh) |
Upload one-time parameters (really just once) such as noise textures. | |
void | render_scene (ID3D11DeviceContext *context, float *clear_color, ID3D11DepthStencilView *dsv) |
Clear the GBufer and render the scene. | |
Protected Member Functions inherited from dune::deferred_renderer | |
void | overlay (ID3D11DeviceContext *context, ID3D11RenderTargetView *backbuffer) |
Render a selected target into a small preview window on top of the backbuffer. | |
void | deferred (ID3D11DeviceContext *context, ID3D11RenderTargetView *backbuffer) |
Render the deferred pass with an optional postprocessing pass. | |
A Delta Radiance Field renderer for augmented reality.
This class is an implementation of an augmented reality relighting renderer using Delta Radiance Fields (see README.md for more information on publications). Depending on the define #DLPV, this class will use different volumetric GI methods to relight the surrounding scene: if #DLPV is set, Delta Light Propagation Volumes will be used for GI. If #DLPV isn't set, Delta Voxel Cone Tracing will do the job.
A Kinect camera is required to run this sample as a true AR renderer. A marker to print out is available in /data/marker.png.
If you do not have a Kinect or haven't compiled Dune with support for the Microsoft Kinect SDK (i.e #MICROSOFT_KINECT_SDK isn't defined), you can still use the sample with a static background (see /data/real_static_scene.png), which is a snapshot frame of a Kinect color image.
|
inlineprotected |
Compute global illumination for the scene.
This method first makes sure that the RSM/GI solution needs to be updated. If so, a new RSM is rendered for one directional light, which will then be injected into a volume and further processed.
References dune::profile_query::begin(), dune::differential_directional_light::mu(), render_drf(), dc::rsm_renderer< dune::differential_directional_light >::render_rsm(), dune::profile_query::result(), dune::differential_directional_light::rho(), and dc::rsm_renderer< dune::differential_directional_light >::update_rsm_camera_parameters().