WIP: Implement Goldsrc render modes#137
Draft
eira-fransham wants to merge 2 commits intoNoxmore:mainfrom
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/renderamtkeys and the meaning of their values are hard-coded inbsp::loader::scene(and.mapfiles 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 likeBspConfig::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:
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.