Two Res Frambuffer

class TwoResFramebuffer

A framebuffer class for mixed-resolution rendering.

Public Functions

virtual void RestoreDeviceObjects(crossplatform::RenderPlatform*)

Platform-dependent function called when initializing the framebuffer.

virtual void InvalidateDeviceObjects()

Platform-dependent function called when uninitializing the water framebuffer.

void SetProjection(const float *p)

Assign the current frame’s projection matrix for this buffer. Just for debugging.

void SetCubeFrustumRange(int i, vec4 r)

Set the range of the cubemap that’s in the current frustum.

uint4 GetCubeIntegerFrustumRange(int i) const

Get the range in terms of the buffer size as integers.

virtual void DeactivateDepth(crossplatform::GraphicsDeviceContext&)

Deactivate the depth buffer.

void CompleteFrame(long long framenumber)

This must be called to ensure that the amortization struct is up to date.

void RenderDepthBuffers(crossplatform::GraphicsDeviceContext &deviceContext, crossplatform::Texture *depthTexture, const crossplatform::Viewport *viewport, int x0, int y0, int dx, int dy)

Debugging onscreen info:

  • deviceContext[inout] Context for the device.

  • depthTexture – The main depth texture.

  • viewport – The viewport in use for the depth texture.

  • x0 – The left edge of area to use for the debug display.

  • y0 – The top of this debug display.

  • dx – The width of the display.

  • dy – The height of the display.

void UpdatePixelOffset(const crossplatform::ViewStruct &viewStruct)

Update the pixel offset for the specified view.

void Swap()

Swap stochastic texture buffers.

crossplatform::Texture *GetStochasticDepthTexture(int idx = -1)

Returns the low-res depth texture.

crossplatform::Texture *GetUpdateTexture(int idx)

A texture that shows what texels are up to date. Where the value is zero, we should fill all the values.

Public Members

vec2 pixelOffset

Offset in pixels from top-left of the low-res view to top-left of the full-res.