Skip to content

Conversation

slipher
Copy link

@slipher slipher commented Aug 23, 2025

Fixes #6 (Warn: R_RemapShader: new shader textures/thunder/blend not found). The visible consequence of this bug was that one of the lighting bolts is displayed at the beginning of the map.

unvanquished_2025-08-23_001606_000

Beyond that, the mistake didn't have further consequences because it was canceled out by an engine bug. When the replacement shader is not found, and it has already been searched previously, R_RemapShader uses a "defaulted" shader, which are never supposed to be used for rendering, as the replacement. The defaulted shader has 0 stages so it renders nothing, which happens to be what textures/thunder/blend is supposed to do.

Fixes #6 (Warn: R_RemapShader: new shader textures/thunder/blend not
found). The visible consequence of this bug was that one of the lighting
bolts is displayed at the beginning of the map.

Beyond that, the mistake didn't have further consequences because it was
canceled out by an engine bug. When the replacement shader is not found,
R_RemapShader uses a "defaulted" shader, which are never supposed to be
used for rendering, as the replacement. The defaulted shader has 0
stages so it renders nothing, which happens to be what
textures/thunder/blend is supposed to do.
slipher added a commit to slipher/Daemon that referenced this pull request Aug 23, 2025
Make R_RemapShader handle shader registration flags correctly. For each
version of the shader, register the replacement shader with a matching
set of flags, instead of always using RSF_DEFAULT.

Also this fixes a bug that when the replacement shader was not found,
the 'defaulted' shader (one that was not found or failed parsing) for
rendering. New behavior is to not change the replacement state. Note
that Thunder has recently been relying on this bug - see
UnvanquishedAssets/map-thunder_src.dpkdir#7
slipher added a commit to slipher/Daemon that referenced this pull request Aug 23, 2025
Make R_RemapShader handle shader registration flags correctly. For each
version of the shader, register the replacement shader with a matching
set of flags, instead of always using RSF_DEFAULT.

Also this fixes a bug that when the replacement shader was not found,
the 'defaulted' shader (one that was not found or failed parsing) for
rendering. New behavior is to not change the replacement state. Note
that Thunder has recently been relying on this bug - see
UnvanquishedAssets/map-thunder_src.dpkdir#7
slipher added a commit to slipher/Daemon that referenced this pull request Aug 27, 2025
Make R_RemapShader handle shader registration flags correctly. For each
version of the shader, register the replacement shader with a matching
set of flags, instead of always using RSF_DEFAULT.

Also this fixes a bug that when the replacement shader was not found,
the 'defaulted' shader (one that was not found or failed parsing) for
rendering. New behavior is to not change the replacement state. Note
that Thunder has recently been relying on this bug - see
UnvanquishedAssets/map-thunder_src.dpkdir#7
slipher added a commit to slipher/Daemon that referenced this pull request Sep 25, 2025
Make R_RemapShader handle shader registration flags correctly. For each
version of the shader, register the replacement shader with a matching
set of flags, instead of always using RSF_DEFAULT.

Also this fixes a bug that when the replacement shader was not found,
the 'defaulted' shader (one that was not found or failed parsing) was
used for rendering. New behavior is to not change the replacement state.
Note that Thunder has recently been relying on this bug - see
UnvanquishedAssets/map-thunder_src.dpkdir#7
slipher added a commit to DaemonEngine/Daemon that referenced this pull request Sep 25, 2025
Make R_RemapShader handle shader registration flags correctly. For each
version of the shader, register the replacement shader with a matching
set of flags, instead of always using RSF_DEFAULT.

Also this fixes a bug that when the replacement shader was not found,
the 'defaulted' shader (one that was not found or failed parsing) was
used for rendering. New behavior is to not change the replacement state.
Note that Thunder has recently been relying on this bug - see
UnvanquishedAssets/map-thunder_src.dpkdir#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad shader remap
1 participant