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

getMaterialTexture in model.lua fails to to build filenames correctly #9

Open
andrewmcwatters opened this issue Oct 24, 2021 · 5 comments

Comments

@andrewmcwatters
Copy link
Member

Describe the bug
getMaterialTexture in model.lua:ln:105 fails to build correct filenames to material textures. This is caused by outdated assimp bindings causing the first 4 characters of filenames to be missing.

To Reproduce
Steps to reproduce the behavior:

  1. Run ./lgf
  2. See error

Expected behavior
Running ./lgf should not produce crashes. getMaterialTexture should provide correct filenames.

Additional context
Stack traceback:

luajit: ...mcwatters/Planimeter/lgf/lua/framework/graphics/mesh.lua:27: not found
stack traceback:
	[C]: in function 'error'
	...cwatters/Planimeter/lgf/lua/framework/graphics/image.lua:29: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'newImage'
	...mcwatters/Planimeter/lgf/lua/framework/graphics/mesh.lua:27: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'processMesh'
	...cwatters/Planimeter/lgf/lua/framework/graphics/model.lua:193: in function 'processNode'
	...cwatters/Planimeter/lgf/lua/framework/graphics/model.lua:219: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'newModel'
	/Users/andrewmcwatters/Planimeter/lgf/main.lua:55: in function 'load'
	...rs/andrewmcwatters/Planimeter/lgf/lua/framework/init.lua:89: in function 'main'
	...rs/andrewmcwatters/Planimeter/lgf/lua/framework/init.lua:272: in main chunk
	[C]: at 0x0100c371d0

Filenames created:

models/DamagedHelmet/gltf/ult_AO.jpg
models/DamagedHelmet/gltf/ult_emissive.jpg
models/DamagedHelmet/gltf/ult_albedo.jpg
models/DamagedHelmet/gltf/ult_normal.jpg

Filenames expected:

models/DamagedHelmet/gltf/Default_AO.jpg
models/DamagedHelmet/gltf/Default_emissive.jpg
models/DamagedHelmet/gltf/Default_albedo.jpg
models/DamagedHelmet/gltf/Default_normal.jpg

See also
LWJGL/lwjgl3#516

@PetriKiviniemi
Copy link

Hey, you ever managed to resolve this?

@andrewmcwatters
Copy link
Member Author

@PetriKiviniemi I think I just need to update the bindings, actually. I can try to schedule this for this evening. This just requires an update to https://github.com/Planimeter/lassimp.

@PetriKiviniemi
Copy link

Hmm sorry I got the threads confused. I am struggling with original assimp on my own custom game-engine. I have the same issue, of where 4 chars are being cut out, even with latest assimp. Was thinking of doing some patching to the assimp library itself, but is there some better way?

@andrewmcwatters
Copy link
Member Author

Ah I see, you're using lwjgl and it is suffering from the same issue. You may be better off not patching assimp, and writing your own utility function to expand the filenames expected instead.

I'm surprised that this would still be occurring with the latest version of assimp.

@andrewmcwatters
Copy link
Member Author

@PetriKiviniemi It looks like it should have been fixed. See assimp/assimp#3264. The latest version is now 5.4.0. I assume this was addressed quite some time ago, but I haven't checked in the latest version since about 6 years ago, back when 4.1.0 had this issue.

Time flies! Let me know if I can help you, even though this isn't related to Planimeter Game Framework!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants