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

Expose Image.load_{format}_from_buffer() for OpenEXR #676

Open
paulherman opened this issue Apr 7, 2020 · 4 comments
Open

Expose Image.load_{format}_from_buffer() for OpenEXR #676

paulherman opened this issue Apr 7, 2020 · 4 comments

Comments

@paulherman
Copy link

Describe the project you are working on:
Trying to provide a clone of another game (MU).

Describe the problem or limitation you are having in your project:
The original game uses BMP and TGA files for textures.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Exposing Load.*FromBuffer for said formats. This is already implemented in the core of the engine so just wiring is needed.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Add another function pointer in the Image class and initialize it in the constructor of the two formats (just like for JPEG).

Probably more wiring is needed in places like this.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not sure.

Is there a reason why this should be core and not an add-on in the asset library?:
The API should be uniform.

@Calinou
Copy link
Member

Calinou commented Apr 28, 2020

Since BMP and TGA formats are supported via modules (rather than built-in drivers), this is probably not trivial.

@fire
Copy link
Member

fire commented Jun 30, 2020

Are you able to get exr working too?

Use case loading exr at runtime for hdr terrain textures and other forms of bit packing buffers into hdr.

@Calinou Calinou changed the title Expose Load{image}FromBuffer for other formats (e.g. TGA, BMP) Expose Load{image}FromBuffer for other formats (e.g. BMP, OpenEXR) Oct 20, 2020
@Calinou Calinou changed the title Expose Load{image}FromBuffer for other formats (e.g. BMP, OpenEXR) Expose Image.load_{format}_from_buffer for more image formats such as BMP and OpenEXR Oct 20, 2020
@Calinou Calinou changed the title Expose Image.load_{format}_from_buffer for more image formats such as BMP and OpenEXR Expose Image.load_{format}_from_buffer() for more image formats such as BMP and OpenEXR Oct 20, 2020
Calinou added a commit to Calinou/godot that referenced this issue Oct 20, 2020
@Anutrix
Copy link

Anutrix commented Nov 8, 2020

BMP done in godotengine/godot#42947.

akien-mga pushed a commit to akien-mga/godot that referenced this issue Nov 11, 2020
GryphonClaw pushed a commit to GryphonClaw/godot that referenced this issue Nov 19, 2020
HEAVYPOLY pushed a commit to HEAVYPOLY/godot that referenced this issue Dec 14, 2020
schme pushed a commit to schme/godot that referenced this issue Mar 29, 2021
@Calinou Calinou changed the title Expose Image.load_{format}_from_buffer() for more image formats such as BMP and OpenEXR Expose Image.load_{format}_from_buffer() for OpenEXR Jan 12, 2022
@Calinou
Copy link
Member

Calinou commented Jan 12, 2022

For Image.load_exr_from_buffer() to be implemented, the OpenEXR module would have to be compiled in release templates. Unfortunately, doing so would increase binary size by about 200 KB, which is non-negligible when targeting mobile and web platforms where fast downloads are paramount to a good experience.

The same problem also applies to making Image.save_exr() work in non-editor builds.

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

4 participants