GPU texture abstraction for 2D images.
Core type definitions and utilities for ESEngine.
TextureHandle getAlbedoAttachment() const
The third colour attachment, the surface's diffuse colour (RGBA8, alpha 1 where a surface wrote it).
Framebuffer & operator=(const Framebuffer &)=delete
u32 getHeight() const
Gets the framebuffer height in pixels.
TextureHandle getGBufferAttachment() const
The second colour attachment, resolved like the first (Invalid when the target has none).
TextureHandle getDepthAttachment() const
Gets the depth attachment texture (Invalid if none).
void bind() const
Binds the framebuffer for rendering.
u32 getWidth() const
Gets the framebuffer width in pixels.
static Unique< Framebuffer > create(GfxDevice &device, const FramebufferSpec &spec)
Creates a framebuffer from specification.
const FramebufferSpec & getSpecification() const
Gets the framebuffer specification.
FramebufferHandle handle() const
Gets the device framebuffer handle.
void unbind() const
Unbinds the framebuffer.
Framebuffer(const Framebuffer &)=delete
void resize(u32 width, u32 height)
Resizes the framebuffer.
TextureHandle getColorAttachment() const
Gets the color attachment texture.
Abstract graphics device interface.
FramebufferHandle
Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted.
std::unique_ptr< T > Unique
Unique ownership smart pointer.
std::uint32_t u32
Unsigned 32-bit integer.
Framebuffer creation parameters.
GfxPixelFormat colorFormat
Color attachment format. RGBA16F needs GfxDevice::supportsFloatTargets.
bool gbuffer
A second colour attachment (RGBA8) drawn in the same pass: the surface's material,...
bool depthStencil
Whether to create depth/stencil attachment.
bool linearFilter
Texture filter mode: false=GL_NEAREST, true=GL_LINEAR.
u32 samples
Number of samples for MSAA (1 = no multisampling).
u32 height
Framebuffer height in pixels.
bool storage
The colour attachment can also be written by a compute shader (GfxDevice::supportsCompute).
u32 width
Framebuffer width in pixels.