VOGONS

Common searches


First post, by a0divided

User metadata
Rank Newbie
Rank
Newbie

On integrated graphics cards like Intel HD, or perhaps on specific cards by Nvidia/AMD, there is a well-known performance bug that happens whenever dynamic lighting is present, such as on the flashlight. Having the flashlight on alone could tank the framerate to near-unplayable speeds, and other flickering lights create a noticeable lag spike. This only happens on the OpenGL renderer and not on Direct3D, and unfortunately the Steam version had its D3D render removed ever since it was ported to Linux/Mac in 2013.

As a sort of experiment, using GLIntercept (https://github.com/dtrebilco/glintercept), and using the command gl_dump in console to get a list of OpenGL extensions that the game detected, I attempted to remove a number of extensions until I came across one: "GL_ARB_multitexture". By removing this specific extension from being detected and used by the game, not only did it seemingly fix the performance around the lights, it also fixes gl_overbright so that it actually works on maps using that feature. Kind of surprised since overbrights don't normally function in the GL renderer.

This was only tested on an Intel HD laptop and nothing else. I also don't know if multitexturing is important in HL, so something could break by turning it off.
1. Download and install the 32 bit version of GLIntercept 1.3.4 from Github (GLIntercept_1_3_4.exe).
2. Go to its install directory and copy opengl32.dll to your Half-Life directory. Set opengl32.dll to read only.
3. Download my gliConfig.ini below and place it into your Half-Life directory.
If it works, you should see a file called "gliLog.txt" created when the game is run.

Attachments

  • Filename
    gliConfig.ini
    File size
    19.54 KiB
    Downloads
    1010 downloads
    File license
    Fair use/fair dealing exception

Reply 1 of 11, by Firtasik

User metadata
Rank Oldbie
Rank
Oldbie

Nice one, but removing GL_ARB_multitexture means no detail textures, I guess.
Oh, and don't try to connect to VAC-secured servers with custom OpenGL32.dll. 😉

11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111

Reply 2 of 11, by leileilol

User metadata
Rank l33t++
Rank
l33t++
a0divided wrote:

Kind of surprised since overbrights don't normally function in the GL renderer.

Modulation never worked well for multitexturing in 98-99 hardware (the color precision isn't that great - think Riva128 blending) so it's for performance and visual clarity to clamp it in the middle and do a subtract.

Unreal went through the same for GlideDrv starting at 218 too! Overbrights never worked in multitexturing there. In addition the detail textures are also similarly clamped and changed into a subtract (with a bit of depth hackery to make them smooth out without the need of a mipmap fade trick)

I've once tried implementing texture combine with overbrights in a Q2 renderer once. It looked TERRIBLE on a Voodoo2, so I can see why they didn't bother. Q3A's brighten-the-screen method made 400% more sense to me since.

apsosig.png
long live PCem

Reply 3 of 11, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie
Firtasik wrote:

Nice one, but removing GL_ARB_multitexture means no detail textures, I guess.

Multitexture has nothing to do with detailed texture usage. All "multitexture" means is the GPU doesn't need to do multiple passes to apply more than one texture onto a object. Or something like that.

You're better off reading the "OpenGL 1.2.1 Specification", Appendix F.2 talks about it in detail.

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 4 of 11, by Firtasik

User metadata
Rank Oldbie
Rank
Oldbie

GLIntercept disables r_detailtextures & r_detailtexturessupported.

Attachments

  • GLInterceptOff.png
    Filename
    GLInterceptOff.png
    File size
    32.36 KiB
    Views
    7031 views
    File comment
    Without GLIntercept
    File license
    Fair use/fair dealing exception
  • GLInterceptOn.png
    Filename
    GLInterceptOn.png
    File size
    25.28 KiB
    Views
    7031 views
    File comment
    With GLIntercept
    File license
    Fair use/fair dealing exception

11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111

Reply 5 of 11, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

Don't know if it is the same issue, but the i845gv shows MASSIV framedrops in SOF1 when flash-lightning due gunfire.
It's seems that GMA950 does not show this anymore.

Retro-Gamer 😀 ...on different machines

Reply 6 of 11, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie
Firtasik wrote:

GLIntercept disables r_detailtextures & r_detailtexturessupported.

... since when did Half-Life even have "detail textures" to start with?

Also Unreal Engine 1 games can display their detail textures even if there is no MultiTexture support. Really, I think you're confusing ARB_multitexture's purpose...

Anyways, you're not going to beable to use the fix described on any mods for Half-Life that include their own opengl32.dll, which makes me wonder why there isn't something like environment variables to forcefully disable GL extensions. (Linux does if you're using Mesa and open source drivers)

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 7 of 11, by Firtasik

User metadata
Rank Oldbie
Rank
Oldbie

Where did I write "Half-Life"? r_detailtextures is set to 0 in my "Without GLIntercept" screenshot. I was thinking about GoldSrc and this thread isn't about Unreal Engine.

a0divided wrote:

"GL_ARB_multitexture". By removing this specific extension from being detected and used by the game, not only did it seemingly fix the performance around the lights, it also fixes gl_overbright so that it actually works on maps using that feature. Kind of surprised since overbrights don't normally function in the GL renderer.

Nvidia Profile Inspector method:
https://pcgamingwiki.com/wiki/Half-Life#OpenG … bright_lighting

Doing this will disable multi-texturing, which has the side-effect of disabling detail textures, which may effect the appearance of user levels and mods.

11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111

Reply 8 of 11, by a0divided

User metadata
Rank Newbie
Rank
Newbie

Yeah, disabling multitexturing does disable detail textures, but this is pretty much the only solution I could find for integrated graphics users. The only other solution is to set r_dynamic to 0, which disables all dynamic lighting and obviously that makes the game unplayable during flashlight sections. Using a custom OpengGL32.dll is necessary because there is no other way to limit extensions on Intel as far as I know.

Firtasik wrote:

Nvidia Profile Inspector method:
https://pcgamingwiki.com/wiki/Half-Life#OpenG … bright_lighting

Doing this will disable multi-texturing, which has the side-effect of disabling detail textures, which may effect the appearance of user levels and mods.

That does not work for anyone without an Nvidia card though.

Reply 9 of 11, by Firtasik

User metadata
Rank Oldbie
Rank
Oldbie

Yes, your method also covers non-Nvidia GPUs. 😀

BTW, I've checked these GoldSrc games on Steam:

Counter-Strike
Counter-Strike: Condition Zero
Counter-Strike: Condition Zero Deleted Scenes
Day of Defeat
Deathmatch Classic
Half-Life
Half-Life: Blue Shift
Half-Life: Opposing Force
Ricochet
Team Fortress Classic

It seems that only Day of Defeat and Counter-Strike: Condition Zero have detail textures.

11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111

Reply 10 of 11, by silikone

User metadata
Rank Member
Rank
Member

The problem with gl_overbright is that it only works on the environment. Entities are not multitextured, and are thus only at most 100% bright. Steam's Half-Life however attempts to overbrighten whether you want it to or not, only to clamp it at the default max brightness value if the multitexture extension is detected, which results in nasty flat lighting instead of it simply darkening the entire scene.
I pray for the Sven Co-op guys to cherish the NVIDIA TNT way by scaling the output before writing to the framebuffer.

Do not refrain from refusing to stop hindering yourself from the opposite of watching nothing other than that which is by no means porn.

Reply 11 of 11, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
DracoNihil wrote:

Anyways, you're not going to beable to use the fix described on any mods for Half-Life that include their own opengl32.dll

Why not? In your custom opengl32.dll (loaded by the game) you can load the (renamed) opengl32.dll provided by the mod, which in turn will load the real one from the OS.