ARB fragment program fallback for GL_ATI_texture_env_combine3 / GL_NV_texture_env_combine4#778
Draft
ARB fragment program fallback for GL_ATI_texture_env_combine3 / GL_NV_texture_env_combine4#778
Conversation
Implement fragment program fallback paths for specular reflection, per-pixel lighting, and lightmap rendering when GL_ATI_texture_env_combine3 and GL_NV_texture_env_combine4 extensions are not available but GL_ARB_fragment_program is (e.g., Intel HD graphics). This fixes armor reflection being disabled on Intel HD graphics. Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement fragment program fallback for texture environment combine
ARB fragment program fallback for GL_ATI_texture_env_combine3 / GL_NV_texture_env_combine4
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Intel HD graphics, neither
GL_ATI_texture_env_combine3norGL_NV_texture_env_combine4is available, disabling specular reflection (armor), per-pixel lighting, and multi-lightmap-per-pass rendering.GL_ARB_fragment_programis available on these GPUs and can emulate the required MAD (multiply-add) operations.Fragment programs added (
driver_opengl.cpp)tex1 * prev.a + prev(with base texture) andtex1 + primary(without)cubemap * lightColor + primary— diffuse per-pixel lighting (2 stages)program.envparamsPrograms are compiled in
initFragmentShaders()only when combine extensions are absent but ARBFragmentProgram is present. Cleaned up indeleteARBFragmentPrograms().Rendering paths updated (
driver_opengl_material.cpp)beginSpecularMultiPass()/setupSpecularPass(): single-pass specular via fragment program instead of broken 2-pass fallback (which was#ifdef'd out due to Intel texture bugs)setupPPLPass()/setupPPLNoSpecPass(): early-return path binds fragment program with light colors asprogram.envuniforms, skipping all texenv setupcomputeLightMapInfos()/setupLightMapPass(): up to 3 lightmaps per pass (previously fell back to 1)end*MultiPass()functions disableGL_FRAGMENT_PROGRAM_ARBwhen the fallback was activeCapability detection (
driver_opengl.cpp)checkForPerPixelLightingSupport():ARBFragmentProgramnow qualifies as combine supportExample specular fragment program:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.