Bug 6077 - OpenGL2: Add r_ignoreDstAlpha
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Video
Version: GIT MASTER
Hardware: PC Windows NT
: P3 minor
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2013-12-17 07:05 EST by James Canete
Modified: 2013-12-17 07:10:34 EST
0 users

See Also:



Description James Canete 2013-12-17 07:05:05 EST
OpenGL2 uses a RGBA16F framebuffer when rendering in HDR.  This was changed from a RGB16F framebuffer because the former is 64bpp and four-byte aligned, whereas the latter is 48bpp and not.  Not being four-byte aligned lead to problems on certain hardware.

OpenGL1 doesn't require an alpha channel for its framebuffer, but certain material shaders are written as if it did, utilizing GL_DST_ALPHA and GL_ONE_MINUS_DST_ALPHA.

This lead to certain materials looking different between the two renderers.

This patch adds a cvar to OpenGL2, r_IgnoreDstAlpha, default 1.  When on, this causes parsed material shaders to treat GL_DST_ALPHA and GL_ONE_MINUS_DST_ALPHA as GL_ONE and GL_ZERO, respectively.  This reproduces the behaviour of having no alpha channel in OpenGL2, and can be turned off if material shaders expecting the alpha channel are used.