Base class for 3D rendering pipelines.
More...
Inherits G3D::ReferenceCountedObject.
Inherited by G3D::DefaultRenderer.
|
virtual void | computeGBuffer (RenderDevice *rd, const Array< shared_ptr< Surface >> &sortedVisibleSurfaces, const shared_ptr< GBuffer > &gbuffer, const shared_ptr< Framebuffer > &depthPeelFramebuffer, float depthPeelSeparationHint) |
| Render z-prepass, depth peel, and G-buffer. More...
|
|
virtual void | computeShadowing (RenderDevice *rd, const Array< shared_ptr< Surface >> &allSurfaces, const shared_ptr< GBuffer > &gbuffer, const shared_ptr< Framebuffer > &depthPeelFramebuffer, LightingEnvironment &lightingEnvironment) |
| Compute ambient occlusion and direct illumination shadow maps. More...
|
|
virtual void | cullAndSort (const shared_ptr< Camera > &camera, const shared_ptr< GBuffer > &gbuffer, const Rect2D &viewport, const Array< shared_ptr< Surface >> &allSurfaces, Array< shared_ptr< Surface >> &sortedVisibleSurfaces, Array< shared_ptr< Surface >> &forwardOpaqueSurfaces, Array< shared_ptr< Surface >> &forwardBlendedSurfaces) |
|
Appends to sortedVisibleSurfaces and forwardSurfaces. More...
|
|
virtual void | forwardShade (RenderDevice *rd, Array< shared_ptr< Surface > > &surfaceArray, const shared_ptr< GBuffer > &gbuffer, const LightingEnvironment &environment, const RenderPassType &renderPassType, Order order) |
| Forward shade everything in surfaceArray. More...
|
|
|
template<class T , class ... ArgTypes> |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
| Like std::make_shared, but works for protected constructors. More...
|
|
Base class for 3D rendering pipelines.
- See also
- GApp::onGraphics3D
◆ Order
Enumerator |
---|
FRONT_TO_BACK | Good for early depth culling.
|
BACK_TO_FRONT | Good for painter's algorithm sorted transparency.
|
ARBITRARY | Allows minimizing state changes by batching primitives.
|
◆ className()
virtual const String& G3D::Renderer::className |
( |
| ) |
const |
|
pure virtual |
◆ computeGBuffer()
virtual void G3D::Renderer::computeGBuffer |
( |
RenderDevice * |
rd, |
|
|
const Array< shared_ptr< Surface >> & |
sortedVisibleSurfaces, |
|
|
const shared_ptr< GBuffer > & |
gbuffer, |
|
|
const shared_ptr< Framebuffer > & |
depthPeelFramebuffer, |
|
|
float |
depthPeelSeparationHint |
|
) |
| |
|
protectedvirtual |
Render z-prepass, depth peel, and G-buffer.
Called from render().
- Parameters
-
◆ computeShadowing()
Compute ambient occlusion and direct illumination shadow maps.
◆ createShared()
template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared |
( |
ArgTypes &&... |
args | ) |
|
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
◆ cullAndSort()
virtual void G3D::Renderer::cullAndSort |
( |
const shared_ptr< Camera > & |
camera, |
|
|
const shared_ptr< GBuffer > & |
gbuffer, |
|
|
const Rect2D & |
viewport, |
|
|
const Array< shared_ptr< Surface >> & |
allSurfaces, |
|
|
Array< shared_ptr< Surface >> & |
sortedVisibleSurfaces, |
|
|
Array< shared_ptr< Surface >> & |
forwardOpaqueSurfaces, |
|
|
Array< shared_ptr< Surface >> & |
forwardBlendedSurfaces |
|
) |
| |
|
protectedvirtual |
Appends to sortedVisibleSurfaces and forwardSurfaces.
- Parameters
-
sortedVisibleSurfaces | All surfaces visible to the GBuffer::camera(), sorted from back to front |
forwardOpaqueSurfaces | Surfaces for which Surface::canBeFullyRepresentedInGBuffer() returned false. These require a forward pass in a deferred shader. (They may be capable of deferred shading for some pixels covered, e.g., if the GBuffer did not contain a sufficient emissive channel.) |
forwardBlendedSurfaces | Surfaces that returned true Surface::hasBlendedTransparency() because they require per-pixel blending at some locations |
◆ diskFramebuffer()
bool G3D::Renderer::diskFramebuffer |
( |
| ) |
const |
|
inline |
◆ forwardShade()
Forward shade everything in surfaceArray.
Called from render()
- Parameters
-
surfaceArray | Visible surfaces sorted from front to back |
◆ render()
The active camera and time interval are taken from the GBuffer.
- Parameters
-
framebuffer | Target color and depth framebuffer. Will be rendered in high dynamic range (HDR) linear radiance. |
gbuffer | Must be allocated, sized, and prepared. Will be rendered according to its specification by this method. |
allSurfaces | Surfaces not visible to the camera will automatically be culled |
depthPeelFramebuffer | May be nullptr |
lightingEnvironment | Shadow maps will be updated for any lights that require them. AO will be updated if the ambientOcclusion field is non-nullptr. Screen-space color buffer will be updated with textures the next frame. |
tritree | The BVH for ray tracing queries. |
Implemented in G3D::DefaultRenderer.
◆ setDiskFramebuffer()
void G3D::Renderer::setDiskFramebuffer |
( |
bool |
b | ) |
|
|
inline |
◆ m_diskFramebuffer
bool G3D::Renderer::m_diskFramebuffer = false |
|
protected |