The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
Public Member Functions | Protected Member Functions | List of all members
dune::gbuffer Class Reference

A geometry buffer (collection of render_target objects). More...

#include <gbuffer.h>

Inheritance diagram for dune::gbuffer:
dune::shader_resource dune::kinect_gbuffer

Public Member Functions

virtual void destroy ()
 Destroy the shader_resource and free all memory.
 
targets_vec & targets ()
 Returns all render_target objects in this gbuffer.
 
void resize (UINT width, UINT height)
 Resize all render_target objects in this gbuffer to a new width and height.
 
void to_ps (ID3D11DeviceContext *context, UINT start_slot)
 Upload the shader resource to register slot of a pixel shader.
 
void to_gs (ID3D11DeviceContext *context, UINT start_slot)
 Upload the shader resource to register slot of a geometry shader.
 
void to_vs (ID3D11DeviceContext *context, UINT start_slot)
 Upload the shader resource to register slot of a vertex shader.
 
void add_target (const tstring &name, render_target &target)
 Create a new render_target in the gbuffer. These functions basically forward parameters to the render_target's create function.
 
void add_target (const tstring &name, const D3D11_TEXTURE2D_DESC &desc, bool cached=false)
 Create a new render_target in the gbuffer. These functions basically forward parameters to the render_target's create function.
 
void add_target (const tstring &name, const DXGI_SURFACE_DESC &desc, UINT num_mipmaps=1)
 Create a new render_target in the gbuffer. These functions basically forward parameters to the render_target's create function.
 
void add_depth (const tstring &name, DXGI_SURFACE_DESC desc)
 Create a new render_target in the gbuffer. These functions basically forward parameters to the render_target's create function.
 
render_targetoperator[] (const tstring &name)
 Fetch a render_target with its name.
 
const render_targetoperator[] (const tstring &name) const
 Fetch a render_target with its name.
 
- Public Member Functions inherited from dune::shader_resource
virtual void to_cs (ID3D11DeviceContext *context, UINT slot)
 Upload the shader resource to register slot of a compute shader.
 

Protected Member Functions

void srvs (srv_vec &srv_array)
 Fill up a vector of ID3D11ShaderResourceView with the SRVs of all render_target objects in this gbuffer.
 
render_targettarget (const tstring &name)
 Return a named target.
 
const render_targettarget (const tstring &name) const
 Return a named target.
 

Detailed Description

A geometry buffer (collection of render_target objects).

This class is a map of named render_target objects. The name gbuffer is only there because it isn't used as a simple collection anywhere in the Dirtchamber. Each gbuffer can hold 0-N targets which are either added directly, or with helper functions called add_target or _add_depth. Resizing a gbuffer resizes all targets in it, and it is assumed that targets are all of equal size (even though they don't have to be).


The documentation for this class was generated from the following files: