Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a proper material system #4519

Open
kduske opened this issue Mar 6, 2024 · 1 comment
Open

Introduce a proper material system #4519

kduske opened this issue Mar 6, 2024 · 1 comment
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Enhancement New features
Milestone

Comments

@kduske
Copy link
Collaborator

kduske commented Mar 6, 2024

Currently, TrenchBroom only knows texture assets. The textures are enhanced with some material properties such as the filtering mode, the mode of transparency, Quake 2 surface flags / content flags, and some Quake 3 shader properties.

In addition, we bolted on support for Quake 3 shader loading. This is particularly awkward and hard to debug.

We should separate materials from textures. We would end up with a material manager and a texture manager. Materials would be scanned and loaded immediately when a map is loaded (or if triggered manually by the user).

For Quake 3, this would include finding, loading, parsing and creating the shaders. For most other games, this would just mean scanning the filesystem for images and automatically generating materials for them depending on the game, image format, and other properties (e.g. fence textures in Quake have a special character in the filename).

Texture images would be loaded on demand when they first need to be displayed. This would improve loading times considerably because textures that are never displayed because they are not used and filtered out from the browser would never need to be loaded.

We could finally model the different transparency modes properly and handle them in the shaders. This would solve issues such as #4440.

@kduske kduske added Type:Enhancement New features Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. labels Mar 6, 2024
@kduske kduske added this to the Next milestone Mar 6, 2024
@eGax
Copy link
Contributor

eGax commented Mar 6, 2024

That would be wonderful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Enhancement New features
Projects
None yet
Development

No branches or pull requests

2 participants