ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.75k stars 630 forks source link

Nightvision/Flashlight lag fix #2066

Open GuskiS opened 11 years ago

GuskiS commented 11 years ago

Fix lags caused by nightvision and flashlight with bad grafics cards.

olavd commented 11 years ago

Please read the bit about reporting bugs: https://github.com/ValveSoftware/steam-for-linux

johndrinkwater commented 11 years ago

GuskiS, this is likely not a bug, but a feature of producing the flashlight… unlikely to get fixed.

GuskiS commented 11 years ago

Isn't a bug when your FPS drops more then a half while using nightvision or flashlight?

olavd commented 11 years ago

@GuskiS Not really if your GPU can't handle it. However, it would be helpful if you told us about your set-up.

GuskiS commented 11 years ago

Well, I'm having intels HD grafics card, I know it's very weak, but it should handle goldsource, as in source engine it doesnt lag for me.

olavd commented 11 years ago

I suggest you write a proper report so they can look into this.

bdeen-valve commented 11 years ago

Which game?

GuskiS commented 11 years ago

Counter-Strike 1.6, but I suppose it's in all goldsource engine games which have nightvision/flashlight.

demencia commented 11 years ago

I have the same issue, I believe the problem is in the graphic card. Night Vision and Flashlight drop fps to half or less, it's really annoying when someone turns on the FL.

911r0ck commented 11 years ago

Same here in opengl and with d3d it is fine but d3d is not good like opengl Its not graphic card problem because in my old computer it used to work fine (without graphic card) and in my new with nvidia gfx it lags o.O Where as in source it doesnt lags and i have searched many areas and many people have this problem in new pcs

LevShisterov commented 11 years ago

It is an issue with dynamic light. Same issue exists in HLDM with any Intel video: when you shoot RPG, dynamic light from the rocket drops FPS to very low values (like from 250 to 10-20-30). r_dynamic 0 completely removes these drops, but this is not good solution. More to say: this is very hard issue, because on Windows, Nvidia locks their drivers to use Intel video on notebooks with Optimus (double video solution).

agrastiOs commented 5 years ago

This is not just on Linux, it happens on Windows too with many Intel iGPUs.

agrastiOs commented 5 years ago

It also happens with all GoldSrc games @kisak-valve

SamVanheer commented 5 years ago

See https://github.com/ValveSoftware/halflife/issues/2565#issuecomment-509409690 for an explanation of the cause of the performance issues.

I'm pretty sure these issues cover the same basic problem, along with #1909, #1578 and #376.

kolcsarlevi commented 4 years ago

I think this is the cause of the FPS drop:

"The GoldSrc engine was written long before modern graphics programming techniques such as vertex buffer objects were around. The OpenGL in GoldSrc (and all other OpenGL games of the time) were executing OpenGL instructions in immediate mode, meaning that everything to be drawn on screen must be sent to the GPU and redrawn every frame -- the GPU forgets everything when it comes to rendering the next frame. AMD (and ATI) GPU's have bad performance issues with immediate mode OpenGL, whereas nVidia GPU's handle this much quicker. You can experience the same issue in Minecraft (before 1.8), as that was entirely using immediate mode OpenGL too. I have exactly the same issue with my AMD R9 280X, where as my (years older) nVidia GTX 560Ti handled Sven Co-op and Minecraft much faster. I did ask AMD about this but they blamed the games (GoldSrc and Minecraft), due to them not making the best use of a modern OpenGL API. I guess nVidia were just nicer when it came to retaining strong compatibility with older software." " First to clear things up, OpenGL is just an API to perform rendering on the graphics card. The graphics engine, "GoldSource", uses this API in an old-fashioned way ("immediate mode") which does not suit modern graphics card architectures at all. My guess is that all the state changes undergo tremendous amounts of conversions through the graphics driver to suit the average modern graphics card, turning the CPU into a bottleneck. " I've been reading up about OpenGL's history and they explicitly note that immediate mode is a deprecated feature kept in the API for backward compatibility only. Hardware drivers have to implement support, but can do this however they please. As noted, nVidia implements it pretty well, whereas AMD does not."