Sei sulla pagina 1di 2

DX11 Deferred Rendering

Source Code: https://bitbucket.org/twntduff/dx11-deferredshading/src

Textures
Textures are loaded using the CreateWICTextureFromFile() function and
stored in an unordered map. Each level requires that textures be loaded and
registered on initialization of the level to ensure that only the necessary
textures are loaded into memory for each individual level.
Meshes
Meshes are loaded from .OBJ files and stored in an unordered map.
Each level requires that meshes be loaded and registered on initialization of
the level to ensure that only the necessary meshes are loaded into memory
for each individual level.
Objects
Every object that has a graphics component, physics component, AI
component, or can be placed in the world derives from the eObject class. The
eSceneComp class is strictly for graphics components that has no physics or
AI capabilities. The eActor class is for physics components that have a
graphics component also. The eVehicle class is for AI components that also
share physics and graphics capabilities. Using inheritance, each object is
stored as an eObject and cast to the proper child class during AI, physics,
and graphics updates. The eLightSource class is for light sources.
Rendering
Rendering to Textures:
The RenderBuffer class stores the resources and functions that allow
the scene to be render to a texture resource instead of the back buffer. There
are many things that can then be done to the texture resource to achieve
unique effects.

Depth Maps:
The depth map is rendered from the light sources point of view and
stores the depth information in a texture. That texture is then used in the

lighting calculations and projected onto the scene to calculate where


shadows will occur.

Down Sampling:
The information that was stored in the depth map is used to render the
scene to a texture that stores the diffuse, ambient, and shadow values from
a single light source to a texture of half the size or more than the depth map.
This texture is then combined with textures calculated from other light
sources to create a multi-lighted scene.

Blurring:
A Gaussian blurring technique is used to create a post processing blur
effect. In this project the blur effect is used to soften the shadows before the
final render. The blurring technique is utilized best when down sampling the
image that is being blurred first and then up sampling image after the blur
technique is used.

Potrebbero piacerti anche