halflife-op4-updated icon indicating copy to clipboard operation
halflife-op4-updated copied to clipboard

Shock Roach texture issue

Open Ronin4862 opened this issue 1 year ago • 6 comments

I'm having this corrupt textures issue with the Shock Roach. It seems to appear only in some instances, but not always.

It's not my OpenGL drivers as I have done a clean install of the latest Geforce Drivers and also did a Restore in Nvidia Control Panel.

https://youtu.be/OvBTUEUj2Zk

Ronin4862 avatar Aug 18 '22 22:08 Ronin4862

I've seen this bug before in Sven Co-op. The model has polygons that face away from the view origin but for some reason they're still rendered, possibly because the engine turns off backface culling.

I can't change the engine's behavior, but it may be possible to remove the polygons from the model. I'll see if that can be done.

SamVanheer avatar Aug 24 '22 09:08 SamVanheer

The area next to that elevator in the video I uploaded is an excellent place to test all the weapons. If I remember correctly the Desert Eagle has the same behavior albeit it has only one white square. Please check yourself if you have the time as I'm away for a few days. I'll check again on Saturday.

Ronin4862 avatar Aug 24 '22 12:08 Ronin4862

I was wrong about the Desert Eagle. Is the Trip Mine and Army Knife, although they differ somewhat:

https://youtu.be/iJj6sLe7kk4

Ronin4862 avatar Aug 27 '22 21:08 Ronin4862

In practice only the Shock Roach is visible. The other two are negligible in my opinion.

Ronin4862 avatar Aug 27 '22 21:08 Ronin4862

I don't know what's going on with those other two models, but all three seem to be caused by some graphical issue in OpenGL. Perhaps specific graphics cards and/or drivers have problems with immediate mode in some cases.

The Shock Roach issue is caused by a specific setup. The model has four attachments used to specify the location of the beam effects. Three of those are attached to bones that only have those polygons that are glitching out here. They're supposed to be invisible, and exist only to prevent the StudioMDL compiler from discarding the bones.

To fix this i can update the compiler to also check if a bone is used by an attachment, which prevents it from being discarded. Then the dummy polygons can be removed (and the texture it uses as well).

The other models don't have any bad geometry in them so i can't really do anything about those.

SamVanheer avatar Sep 08 '22 14:09 SamVanheer

Yes, only the Shock Roach is visible so don't bother with the other two.

Ronin4862 avatar Sep 08 '22 16:09 Ronin4862