Skip to content

WIP: Implement Goldsrc render modes#137

Draft
eira-fransham wants to merge 2 commits intoNoxmore:mainfrom
eira-fransham:goldsrc-render-mode
Draft

WIP: Implement Goldsrc render modes#137
eira-fransham wants to merge 2 commits intoNoxmore:mainfrom
eira-fransham:goldsrc-render-mode

Conversation

@eira-fransham
Copy link
Contributor

@eira-fransham eira-fransham commented Oct 23, 2025

Goldsrc handles some properties on a per-entity basis that in Bevy are handled in the material properties. This PR has an initial implementation of bridging that gap. Currently the rendermode/renderamt keys and the meaning of their values are hard-coded in bsp::loader::scene (and .map files don't have any handling for it, even though they should probably allow it too), but it shouldn't be too tough to allow this to be configurable.

I originally just implemented this because I wanted to get a nice screenshot of one of the Anomalous Materials levels but honestly being able to control material properties per-entity would probably be a useful tool for general level design if it was made configurable.

I think if this was configurable, you could add a "goldsrc_material_property_hook" (or some similar name) that implements HL1-style materials, so if people want HL1-compatible behaviour they have an implementation they can plug in, but the default should probably still be Q1-compatible. Maybe there could be builder methods like BspConfig::default_quake()/BspConfig::default_quake2()/BspConfig::default_half_life() that make a best-effort attempt at using the right hooks etc.

Here's some translucent glass with this technique:

image

There's something odd going on with the implementation of the Goldsrc render modes but I think the general technique for modifying textures makes sense overall.

image

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.

1 participant