From 8dd7f524da987854ba07457daf180c5c5af81d44 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Wed, 20 Nov 2013 00:48:18 -0800 Subject: OpenGL2: Use RGBA16F format for HDR. RGB16F is not 4-byte aligned and not supported by certain hardware. --- src/renderergl2/tr_fbo.c | 2 +- src/renderergl2/tr_image.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/renderergl2') diff --git a/src/renderergl2/tr_fbo.c b/src/renderergl2/tr_fbo.c index 35e2b74d..c76e7db1 100644 --- a/src/renderergl2/tr_fbo.c +++ b/src/renderergl2/tr_fbo.c @@ -386,7 +386,7 @@ void FBO_Init(void) hdrFormat = GL_RGBA8; if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat) { - hdrFormat = GL_RGB16F_ARB; + hdrFormat = GL_RGBA16F_ARB; } qglGetIntegerv(GL_MAX_SAMPLES_EXT, &multisample); diff --git a/src/renderergl2/tr_image.c b/src/renderergl2/tr_image.c index 2b5798ac..f2b52c83 100644 --- a/src/renderergl2/tr_image.c +++ b/src/renderergl2/tr_image.c @@ -2923,7 +2923,7 @@ void R_CreateBuiltinImages( void ) { hdrFormat = GL_RGBA8; if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat) - hdrFormat = GL_RGB16F_ARB; + hdrFormat = GL_RGBA16F_ARB; rgbFormat = GL_RGBA8; @@ -2942,7 +2942,7 @@ void R_CreateBuiltinImages( void ) { unsigned short sdata[4]; void *p; - if (hdrFormat == GL_RGB16F_ARB) + if (hdrFormat == GL_RGBA16F_ARB) { sdata[0] = FloatToHalf(0.0f); sdata[1] = FloatToHalf(0.45f); -- cgit