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

read from memory relative paths #17

Open
Wasabi375 opened this issue Sep 6, 2018 · 0 comments
Open

read from memory relative paths #17

Wasabi375 opened this issue Sep 6, 2018 · 0 comments

Comments

@Wasabi375
Copy link
Contributor

MD3 sometimes uses relative paths to resolve shaders. It's also possible that other formats reference textures with relative paths.
The MemoryIOSystem does not fully support them. It's not possible to use .. to reference the parent directory.
There are 3 options to solve this:

  1. A simple workaround by adjusting the name of a buffer when passing it to the ioSystem eg. "somePath/../../../scripts/object.shader" as the name for the buffer. This works for now but I don't think it's a permanent solution.
  2. modify the ioSystem so that it can handle paths with ".." in them.
  3. Move from using String to java.nio.file.Path to qualify the buffers in MemoryIOSystem. This way resolving paths would be trivial but it would require a full implementation of Path, FileSystem and FileSystemProvider. This is a lot of effort and I'm not sure it's worth it.

I think option 2 is the best on. It should work in all cases. Option 3 is overkill as the user should not interact with the ioSystem themself.

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

1 participant