Fixing Transparent Textures In ETQW With Sdl12-compat
Hey guys! Ever tried to get Enemy Territory: Quake Wars (ETQW) running smoothly on modern systems using sdl12-compat
? It can be a bit of a headache, especially when dealing with those pesky transparent textures. I've been wrestling with this issue, and I'm here to share what I've found and how to (hopefully) fix it. This guide will help you troubleshoot and resolve the broken transparent textures issue, making your gaming experience much better.
The Problem: Broken Textures
So, the deal is, when you try to run ETQW through sdl12-compat
(which is built on top of sdl2-compat
and even SDL3), the transparent textures in the game go haywire. They don't render correctly, which can make the game look pretty messed up. You'll notice this right away – see-through effects will appear solid, and the game's visuals will be off. This issue specifically arises when using sdl12-compat
to allow older games to run on more modern systems. The error often surfaces with Nvidia graphics cards, but it's not limited to them. The core issue lies in how the game interacts with the graphics drivers through the SDL libraries.
The game uses a custom build of SDL 1.2, but we're overriding it with sdl12-compat
. This is where the trouble starts. You'll see a bunch of warnings in the logs related to shader compilation errors. These errors suggest that the game's shaders, which handle the visual effects, aren't being compiled correctly. These warnings usually include messages like "GL_PROGRAM_ERROR_STRING_ARB" and errors related to parsing shader declarations, specifically within the game's render programs like 'trivialrgb' and 'trivialrgbwithtexturematrix'. This indicates a conflict or incompatibility between the game's shader code and the way sdl12-compat
interacts with your graphics drivers.
To reproduce this issue, you'll need the ETQW demo. Install it, and then you'll override the game's built-in SDL 1.2 build with sdl12-compat
. After doing this and running the game, you'll notice the broken textures, with log outputs filled with shader compilation errors. The game relies on Nvidia's cg for shader compilation, meaning that it uses GLX, and so, it won't work on Wayland. You might also encounter issues when attempting to test with Zink, as the game may hang on startup. Therefore, it's important to know the root causes behind the broken transparent textures in ETQW.
Steps to Reproduce the Issue
- Get the ETQW Demo: Download the demo from the link provided in the original report (or find it online).
- Install the Demo: Follow the installation instructions.
- Override SDL 1.2: This is where the magic (and the problem) happens. You'll need to replace the game's default SDL 1.2 library with
sdl12-compat
. Here's how to do that on a Fedora-based system (adjust the paths if you're on a different distro):- Back up the original SDL library:
mv libSDL-1.2.id.so.0 libSDL-1.2.id.so.0.bak
- Create a symbolic link to your
sdl12-compat
library:ln -s /usr/lib/libSDL-1.2.so.0 <install path>/libSDL-1.2.id.so.0
- Back up the original SDL library:
- Run the Game: Use
SDL_VIDEODRIVER=x11 ./etqw-rthread
to launch the game. TheSDL_VIDEODRIVER=x11
part is important because ETQW uses GLX, and Wayland isn't supported. - Observe the Broken Textures: If all goes according to plan (or rather, according to the problem), you should see the transparent textures failing to render correctly.
Troubleshooting and Potential Fixes
Let's dive into how we can fix those broken transparent textures and get ETQW looking good again.
One of the first things to try is updating your graphics drivers. Make sure you have the latest drivers installed for your GPU. Outdated drivers can often cause compatibility issues with older games and the SDL libraries. Another approach is to experiment with different versions of sdl12-compat
. Sometimes, newer or older versions of the library might offer better compatibility with ETQW. If possible, you might also try different versions of the SDL2 and SDL3 libraries that sdl12-compat
depends on. However, remember that this can introduce more complications.
Another solution is to avoid using sdl12-compat
altogether. The game ships with its own SDL 1.2 build, which works fine. The only downside is that mouse grabbing might be broken, meaning your mouse cursor won't be properly captured within the game window, but this is not an issue in itself. To revert back, you simply need to restore the original SDL library that came with the game. Another option is to search for community-made patches or modifications. The gaming community is very resourceful, and someone might have already created a patch that fixes the transparent texture issue while retaining mouse grabbing functionality.
If you are a bit tech-savvy, you can start by examining the shader code. The warning messages in the logs point to the shader files within the game's renderprogs
and materials
directories. Look for any syntax errors or incompatibilities with modern OpenGL versions or driver implementations. You can also try tweaking the game's configuration files. Sometimes, settings related to graphics or rendering might affect how transparent textures are handled. Try experimenting with different settings to see if they make any difference.
Finally, if all else fails, you can consider filing a bug report. If the problem persists and there is no easy fix, you might want to report the issue to the sdl12-compat
developers. They may be able to investigate the problem and offer a solution or update the library to better support ETQW. In your bug report, provide as much detail as possible about your system, the steps you took to reproduce the issue, and the error messages you observed. You can also provide screenshots or videos to help the developers understand the problem.
Examining the Logs
Those log messages I mentioned earlier are your friends! They often contain clues about what's going wrong. The most important messages to focus on are the ones related to shader compilation errors. These messages will tell you which shader files and lines of code are causing trouble. Use these messages to identify the problematic shaders and look for any potential issues.
For instance, you'll often see messages about "GL_PROGRAM_ERROR_STRING_ARB" and errors related to parsing declarations. These are the breadcrumbs that lead you to the root of the problem.
Testing with Different Drivers
If you have access to different graphics cards or drivers, try testing the game on them. This can help you determine whether the issue is specific to your hardware or driver version. For instance, you can test with the proprietary NVIDIA drivers or with the open-source nouveau
drivers. Remember to specify X11 when running the game to ensure it uses GLX.
Conclusion
Fixing those broken transparent textures in ETQW can be a challenge, but it's definitely possible. By following the steps outlined, you can troubleshoot the issue and hopefully get the game looking its best. Remember to keep an eye on those log messages, experiment with different drivers and versions of sdl12-compat
, and don't be afraid to seek help from the community. Good luck, and happy fragging!
For more detailed information about SDL and related libraries, check out the official SDL website: libsdl.org