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

[Feature] Vertex color/Vertex Alpha exporting for Map export #14

Closed
TemperanceTempy opened this issue Sep 3, 2024 · 3 comments · Fixed by #17
Closed

[Feature] Vertex color/Vertex Alpha exporting for Map export #14

TemperanceTempy opened this issue Sep 3, 2024 · 3 comments · Fixed by #17

Comments

@TemperanceTempy
Copy link

Is your feature request related to a problem? Please describe.
I've been working and testing the map exporting features of Meddle for a little bit (mostly through importing the result through blender), and i noticed something. The GLTF/GLB version of the files do not preserve the vertex colors/vertex alphas present in the games map (though the framework for it is still present). I made sure to verify that this was not an issue with blender beforehand.
image
(Framework for a vertex color map is there in areas that are relevant, but is pure white/empty as pictured below with a viewer designed for vertex color viewing)
image

Describe the solution you'd like
As there is framework for the vertex color data to be there, it should be possible to preserve/export the vertex color/vertex alpha data into the gltf/glb format, though I'm unsure of how exactly (I'm not really good at the coding side of things sadly)

Describe alternatives you've considered
Currently godbert was the only program capable of preserving the vertex colors/vertex alphas, but as of dawntrail godbert is currently unusable for the forseeable future

Additional context
Vertex alphas specifically are what allow these terrain transitions to appear smooth, rather than sharp compared to how it looks in blender
image
image

@PassiveModding
Copy link
Owner

Just to elaborate on how terrain blending works from my own understanding.
Terrain materials can have samplers for Color0, Color1, Specular0, Specular1, Normal0 and Normal.
The alpha value of the vertex color is a blend value between the 0 and 1 textures respectively.
Example (only did diffuse here)
image

Currently there are limitations with the complexity of shaders under KHR_materials_pbrSpecularGlossiness since it only supports a single texture for each of these channels.

It may be possible to create a gltf extension and a corresponding blender plugin, but may also be possible to create a standalone blender plugin which uses the values meddle will export in custom properties to remake the correct shaders.

@TemperanceTempy
Copy link
Author

ah thats really interesting! I sadly dont know how to code, so i can't program an extension myself. The sharp cuts of textures have always bothered me in map exports/ports, so maybe its about time i learn how to code LOL. There may also be a workaround as well via color mixing, so ill start experimenting.

@PassiveModding
Copy link
Owner

Just an update on this, it is being worked on via a blender addon, there are some edge-cases to tackle related to vertex painting still however

TerrainBlending.mp4

@PassiveModding PassiveModding linked a pull request Sep 15, 2024 that will close this issue
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 a pull request may close this issue.

2 participants