OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

GL_S3_s3tc not rendering certain textures

Open Fighter19 opened this issue 6 years ago • 9 comments

Operating system and version: CentOS 7.1 (without libtxc_dxtn installed)

Is this for single player or multiplayer? both

Description of the bug (and if possible, steps to reproduce the bug): Many textures are simply not being rendered or are corrupted

What did you expect to happen instead? The textures showing up properly.

This can be fixed by installing libtxc_dxtn and therefor using GL_EXT_texture_compression_s3tc instead of GL_S3_s3tc

EDIT: Related to https://github.com/JACoders/OpenJK/issues/662

Fighter19 avatar Mar 15 '18 10:03 Fighter19

See cvar r_ext_preferred_tc_method

Does console say ...GL_EXT_texture_compression_s3tc available ?

Followed by which one is being used.

https://github.com/JACoders/OpenJK/blob/master/codemp/rd-vanilla/tr_init.cpp#L320-L425

ensiform avatar Mar 15 '18 12:03 ensiform

If libtxc_dxtn is installed, yes.

Initializing OpenGL extensions
...GL_S3_s3tc available
...GL_EXT_texture_compression_s3tc available
...no tc preference specified
.....using GL_EXT_texture_compression_s3tc
...using GL_EXT_texture_env_add
...GL_EXT_texture_filter_anisotropic available
...using GL_EXT_texture_filter_anisotropic
...using GL_EXT_texture_edge_clamp
...using GL_ARB_multitexture
...using GL_EXT_compiled_vertex_array
...GL_NV_register_combiners not found

Else it's:

Initializing OpenGL extensions
...GL_S3_s3tc available
...no tc preference specified
.....using GL_S3_s3tc
...using GL_EXT_texture_env_add
...GL_EXT_texture_filter_anisotropic available
...using GL_EXT_texture_filter_anisotropic
...using GL_EXT_texture_edge_clamp
...using GL_ARB_multitexture
...using GL_EXT_compiled_vertex_array
...GL_NV_register_combiners not found

I'd suggest showing a dialogue at startup that notifies the user that Intel does not work well together with that method and automatically set it, most users probably won't find a fast solution and it probably affects more than just a few people.

Fighter19 avatar Mar 15 '18 13:03 Fighter19

We can't add ingame dialogs, you are better off not using texture compression if it does not work. It is not our job to include a texture compression supplement lib. But we will put a note for linux users of Intel cards.

ensiform avatar Mar 15 '18 13:03 ensiform

I don't expect you to include a lib, I just wanted to point out that issue. I imagined something along the following lines: Disable texture compression at the first start-up for Intel HD Graphics users and notify the user using the X11 dialogue. (the same way it's being currently used when the renderer fails to load).

GL_VENDOR: Intel Open Source Technology Center
GL_RENDERER: Mesa DRI Intel(R) Sandybridge Mobile 
GL_VERSION: 3.0 Mesa 17.0.1

After all libtxc_dxtn doesn't require you do recompile anything, it just somehow works with Mesa (don't ask me how though)

If libtxc_dxtn is installed it will provide the extension without any modification. (I don't know if no compression is better, but I know that Steam requires this library to be installed, so I thought installing the driver (and telling others to do so too) is the right thing to do.)

EDIT: Ways to fix it currently:

  • Tell the user to try starting the game with force_s3tc_enable=true
  • Tell the user to install the lib
  • Tell the user disable compression using r_ext_compressTextures
  • Find out why it happens when using GL_S3_s3tc on Intel.

Fighter19 avatar Mar 15 '18 13:03 Fighter19

All I'm going to do for now is inform the user in console and choose no compression in the scenario.

Find out why it happens when using GL_S3_s3tc on Intel.

My guess is neglected driver support, I'm sure it is not specific to OpenJK having issues with it.

ensiform avatar Mar 15 '18 13:03 ensiform

Sounds good. 👍

Fighter19 avatar Mar 15 '18 13:03 Fighter19

Can you send a pull request to the wiki to make a new wiki page with steps for making sure to have the lib? Or fixing the issue in general by workarounds

ensiform avatar Mar 15 '18 13:03 ensiform

~~I will do it.~~ EDIT: Should simply work in future, see smcv's comment below.

Fighter19 avatar Mar 15 '18 13:03 Fighter19

The S3TC patent has finally expired, so Mesa 17.3 and up should have working S3TC (with or without libtxc_dxtn).

smcv avatar Aug 05 '18 16:08 smcv