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

TBLoader meshes not displaying texture maps besides Albedo #64

Open
18swenskiq opened this issue Feb 2, 2023 · 3 comments
Open

TBLoader meshes not displaying texture maps besides Albedo #64

18swenskiq opened this issue Feb 2, 2023 · 3 comments

Comments

@18swenskiq
Copy link

[Godot 4 Beta16]

When I import my Trenchbroom level, the materials use lots of texture maps besides the albedo, however the meshes created by TBLoader only show the albedo rather than the other maps like normal, height, etc.

The material appears fine if I just apply it to a MeshInstance3D

Pic:
image

The result is the same whether I am in editor or run the game

@codecat
Copy link
Owner

codecat commented Feb 5, 2023

This is weird, because I've definitely used complex materials before. I wonder if it's because the texture and material files have the same base name and are in the same location? (Eg: test.png and test.material)

If that's the case, it might be using the texture before the material.

@18swenskiq
Copy link
Author

You are correct.

That being said, it would be great if different names were supported. For instance, the material being named test.material while the albedo is named test_albedo.png which is what I was trying to do (in Trenchbroom it was using test_albedo as the mat). How this might work is maybe like a checkbox in the TBLoader ent like "use material override", using the lone material in the folder rather than what the brush face is actually textured with.

I didn't assume that a texture would/could be loaded directly, the docs/README was a little bit confusing as well as this is not how any engine I've interacted with works.

If this is something that won't be fixed, it might be nice to reword the docs/README to say something like "a texture can be used instead of a material on imported brush faces, and unless the material name is a 1:1 match it will not be loaded"

@codecat
Copy link
Owner

codecat commented Feb 5, 2023

Ahh I see. Yeah I can understand that would be a problem. Need to think about that. It's hard because I'm not sure TrenchBroom sees anything other than actual image files in its texture browser. Perhaps it could work when a strict filename format is used, like in your example: test_albedo.png could look for test.material, etc.

I didn't assume that a texture would/could be loaded directly, the docs/README was a little bit confusing as well as this is not how any engine I've interacted with works.

It's just a quick way to allow prototyping of maps w/o having to set up the materials for them.

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

No branches or pull requests

2 participants