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

Materials in exported OBJ #237

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Materials in exported OBJ #237

merged 2 commits into from
Dec 14, 2023

Conversation

kvark
Copy link
Owner

@kvark kvark commented Dec 14, 2023

For levels, OBJ export will now create an associated MTL automatically. It looks like this:

newmtl t0
	Kd 0.5176471 0.5647059 0.65882355
newmtl t1
	Kd 0.5803922 0.6431373 0.47058824
newmtl t2
	Kd 0.5176471 0.4392157 0.34509805
newmtl t3
	Kd 0.3764706 0.4392157 0.3764706
newmtl t4
	Kd 0.53333336 0.4392157 0.17254902
newmtl t5
	Kd 0.8 0 0.047058824
newmtl t6
	Kd 0.7529412 0.78431374 0
newmtl t7
	Kd 0.26666668 0.3764706 0.26666668

material-export-level

For objects, all objects are expected to have the same MTL file. It can be generated like this:

cargo run --bin convert -- c:\data\Games\Vangers\data\resource\pal\objects.pal c:\data\Assets\Vangers\game\object.mtl

Then generating an object OBJ and just placing the "object.mtl" near it will make the materials show up:
material-export

I believe this is quite cool, because in any use of these assets having the colors/materials is immediately helpful.

@kvark kvark merged commit 8302320 into master Dec 14, 2023
3 checks passed
@kvark kvark deleted the material branch December 14, 2023 08:36
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