UFO: Alien Invasion
|
Framebuffer Objects support. More...
Go to the source code of this file.
Functions | |
static GLuint | R_GetFreeFBOTexture (void) |
static void | R_FreeFBOTexture (int texnum) |
void | R_InitFBObjects (void) |
void | R_DeleteFBObject (r_framebuffer_t *buf) |
Delete framebuffer object along with attached render buffer. More... | |
void | R_ShutdownFBObjects (void) |
Delete all registered framebuffer and render buffer objects, clear memory. More... | |
r_framebuffer_t * | R_CreateFramebuffer (int width, int height, int ntextures, bool depth, bool halfFloat, unsigned int *filters) |
create a new framebuffer object More... | |
void | R_ResolveMSAA (const r_framebuffer_t *buf) |
Forces multisample antialiasing resolve on given framebuffer, if needed. More... | |
void | R_UseFramebuffer (const r_framebuffer_t *buf) |
bind specified framebuffer object so we render to it More... | |
void | R_SetupViewport (r_framebuffer_t *buf, int x, int y, int width, int height) |
Sets the framebuffer dimensions of the viewport. More... | |
void | R_UseViewport (const r_framebuffer_t *buf) |
Set the viewport to the dimensions of the given framebuffer. More... | |
void | R_DrawBuffers (unsigned int drawBufferNum) |
Activate draw buffer(s) More... | |
void | R_BindColorAttachments (unsigned int n, unsigned int *attachments) |
Activate draw buffer(s) More... | |
bool | R_EnableRenderbuffer (bool enable) |
Enable the render to the framebuffer. More... | |
bool | R_RenderbufferEnabled (void) |
Variables | |
static int | frameBufferObjectCount |
static r_framebuffer_t | frameBufferObjects [MAX_GL_FRAMEBUFFERS] |
static GLuint | frameBufferTextures [MAX_GL_FRAMEBUFFERS] |
static r_framebuffer_t | screenBuffer |
static GLenum * | colorAttachments |
Framebuffer Objects support.
Definition in file r_framebuffer.cpp.
Activate draw buffer(s)
n | The number of buffers to activate |
attachments | The buffers we are rendering into |
Definition at line 404 of file r_framebuffer.cpp.
References rstate_s::activeFramebuffer, Com_DPrintf(), DEBUG_RENDERER, rconfig_t::frameBufferObject, rstate_s::frameBufferObjectsInitialized, cvar_s::integer, rconfig_t::maxDrawBuffers, r_framebuffer_t::nTextures, r_config, r_postprocess, r_programs, and r_state.
Referenced by R_DrawBuffers(), and R_UpdateGlowBufferBinding().
r_framebuffer_t* R_CreateFramebuffer | ( | int | width, |
int | height, | ||
int | ntextures, | ||
bool | depth, | ||
bool | halfFloat, | ||
unsigned int * | filters | ||
) |
create a new framebuffer object
[in] | width | The width of the framebuffer |
[in] | height | The height of the framebuffer |
[in] | ntextures | The amount of textures for this framebuffer. See also the filters array. |
[in] | depth | Also generate a depth buffer |
[in] | halfFloat | Use half float pixel format |
[in] | filters | Filters for the textures. Must have ntextures entries |
Definition at line 175 of file r_framebuffer.cpp.
References rconfig_t::anisotropic, r_framebuffer_t::byteFormat, r_framebuffer_t::clearColor, colorAttachments, Com_Printf(), r_framebuffer_t::depth, r_framebuffer_t::fbo, frameBufferObjectCount, rstate_s::frameBufferObjectsInitialized, GL_CLAMP, GL_DEPTH_ATTACHMENT_EXT, GL_DEPTH_COMPONENT, GL_FRAMEBUFFER_EXT, GL_RENDERBUFFER_EXT, glBindTexture(), glTexImage2D(), r_framebuffer_t::height, i, cvar_s::integer, lengthof, rconfig_t::maxAnisotropic, rconfig_t::maxDrawBuffers, Mem_AllocTypeN, r_framebuffer_t::nTextures, OBJZERO, r_framebuffer_t::pixelFormat, r_framebuffer_t::proxyFBO, R_CheckError, r_config, R_GetFreeFBOTexture(), r_multisample, R_SetupViewport(), r_state, r_framebuffer_t::samples, r_framebuffer_t::textures, Vector4Clear, and r_framebuffer_t::width.
Referenced by R_InitFBObjects().
void R_DeleteFBObject | ( | r_framebuffer_t * | buf | ) |
Delete framebuffer object along with attached render buffer.
Definition at line 126 of file r_framebuffer.cpp.
References r_framebuffer_t::depth, r_framebuffer_t::fbo, i, Mem_Free, r_framebuffer_t::nTextures, R_FreeFBOTexture(), and r_framebuffer_t::textures.
Referenced by R_ShutdownFBObjects().
Activate draw buffer(s)
[in] | drawBufferNum | The number of buffers to activate |
Definition at line 393 of file r_framebuffer.cpp.
References colorAttachments, and R_BindColorAttachments().
Referenced by R_Draw3DGlobe(), R_EnableRenderbuffer(), and R_UpdateGlowBufferBinding().
bool R_EnableRenderbuffer | ( | bool | enable | ) |
Enable the render to the framebuffer.
enable | If true we are enabling the rendering to fbo_render, if false we are rendering to fbo that represents the screen |
true
if the fbo was bound, false
if not supported or deactivated Definition at line 425 of file r_framebuffer.cpp.
References fbo_render, fbo_screen, rconfig_t::frameBufferObject, rstate_s::frameBufferObjectsInitialized, cvar_s::integer, r_config, R_DrawBuffers(), r_postprocess, r_programs, r_state, R_UseFramebuffer(), and rstate_s::renderbuffer_enabled.
Referenced by uiGeoscapeNode::draw(), R_DrawBloom(), R_Setup2D(), and R_Setup3D().
Definition at line 50 of file r_framebuffer.cpp.
References frameBufferTextures, i, and MAX_GL_FRAMEBUFFERS.
Referenced by R_DeleteFBObject().
Definition at line 36 of file r_framebuffer.cpp.
References Com_Error(), ERR_FATAL, frameBufferTextures, glGenTextures(), i, and MAX_GL_FRAMEBUFFERS.
Referenced by R_CreateFramebuffer().
Definition at line 65 of file r_framebuffer.cpp.
References rstate_s::activeFramebuffer, rstate_s::buffers0, rstate_s::buffers1, rstate_s::buffers2, r_framebuffer_t::clearColor, colorAttachments, viddef_t::context, r_framebuffer_t::depth, DOWNSAMPLE_PASSES, DOWNSAMPLE_SCALE, r_framebuffer_t::fbo, fbo_bloom0, fbo_bloom1, rconfig_t::frameBufferObject, frameBufferObjectCount, rstate_s::frameBufferObjectsInitialized, frameBufferTextures, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_EXT, r_framebuffer_t::height, viddefContext_t::height, i, int(), cvar_s::integer, rconfig_t::maxDrawBuffers, Mem_AllocTypeN, r_framebuffer_t::nTextures, OBJZERO, R_CheckError, r_config, R_CreateFramebuffer(), r_programs, R_SetupViewport(), r_state, rstate_s::renderBuffer, screenBuffer, Vector4Clear, viddef, r_framebuffer_t::width, and viddefContext_t::width.
Referenced by R_Init(), R_ReinitOpenglContext(), R_RestartPrograms_f(), and R_SetMode().
bool R_RenderbufferEnabled | ( | void | ) |
Definition at line 443 of file r_framebuffer.cpp.
References r_state, and rstate_s::renderbuffer_enabled.
Referenced by R_DrawBloom().
void R_ResolveMSAA | ( | const r_framebuffer_t * | buf | ) |
Forces multisample antialiasing resolve on given framebuffer, if needed.
[in] | buf | the framebuffer to use |
Definition at line 296 of file r_framebuffer.cpp.
References r_framebuffer_t::fbo, GL_COLOR_ATTACHMENT0_EXT, GL_DRAW_FRAMEBUFFER_EXT, GL_FRAMEBUFFER_EXT, GL_READ_FRAMEBUFFER_EXT, r_framebuffer_t::height, i, r_framebuffer_t::nTextures, r_framebuffer_t::proxyFBO, R_CheckError, r_framebuffer_t::samples, and r_framebuffer_t::width.
Referenced by R_DrawBloom().
Sets the framebuffer dimensions of the viewport.
[out] | buf | The framebuffer to initialize the viewport for. If nullptr the screen buffer will be taken. |
[in] | x,y | The position |
[in] | width,height | The dimensions |
Definition at line 362 of file r_framebuffer.cpp.
References r_viewport_t::height, screenBuffer, r_framebuffer_t::viewport, r_viewport_t::width, r_viewport_t::x, and r_viewport_t::y.
Referenced by R_CreateFramebuffer(), and R_InitFBObjects().
Delete all registered framebuffer and render buffer objects, clear memory.
Definition at line 148 of file r_framebuffer.cpp.
References colorAttachments, frameBufferObjectCount, rstate_s::frameBufferObjectsInitialized, i, Mem_Free, OBJZERO, R_DeleteFBObject(), r_state, and R_UseFramebuffer().
Referenced by R_ReinitOpenglContext(), R_SetMode(), and R_Shutdown().
void R_UseFramebuffer | ( | const r_framebuffer_t * | buf | ) |
bind specified framebuffer object so we render to it
[in] | buf | the framebuffer to use, if nullptr the screen buffer will be used. |
Definition at line 323 of file r_framebuffer.cpp.
References rstate_s::activeFramebuffer, r_framebuffer_t::clearColor, colorAttachments, Com_Printf(), r_framebuffer_t::depth, r_framebuffer_t::fbo, rconfig_t::frameBufferObject, rstate_s::frameBufferObjectsInitialized, GL_FRAMEBUFFER_EXT, cvar_s::integer, r_framebuffer_t::nTextures, R_CheckError, r_config, r_postprocess, r_programs, r_state, and screenBuffer.
Referenced by R_BlurStack(), R_DrawBloom(), R_EnableBlur(), R_EnableRenderbuffer(), and R_ShutdownFBObjects().
void R_UseViewport | ( | const r_framebuffer_t * | buf | ) |
Set the viewport to the dimensions of the given framebuffer.
[out] | buf | The framebuffer to set the viewport for. If nullptr the screen buffer will be taken. |
Definition at line 378 of file r_framebuffer.cpp.
References rconfig_t::frameBufferObject, rstate_s::frameBufferObjectsInitialized, r_viewport_t::height, cvar_s::integer, r_config, r_postprocess, r_programs, r_state, screenBuffer, r_framebuffer_t::viewport, r_viewport_t::width, r_viewport_t::x, and r_viewport_t::y.
Referenced by R_Blur(), R_BlurStack(), and R_DrawBloom().
|
static |
Definition at line 34 of file r_framebuffer.cpp.
Referenced by R_CreateFramebuffer(), R_DrawBuffers(), R_InitFBObjects(), R_ShutdownFBObjects(), and R_UseFramebuffer().
|
static |
Definition at line 29 of file r_framebuffer.cpp.
Referenced by R_CreateFramebuffer(), R_InitFBObjects(), and R_ShutdownFBObjects().
|
static |
Definition at line 30 of file r_framebuffer.cpp.
|
static |
Definition at line 31 of file r_framebuffer.cpp.
Referenced by R_FreeFBOTexture(), R_GetFreeFBOTexture(), and R_InitFBObjects().
|
static |
Definition at line 33 of file r_framebuffer.cpp.
Referenced by R_InitFBObjects(), R_SetupViewport(), R_UseFramebuffer(), and R_UseViewport().