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

S3TC image compression fails on exported project but works in editor #25640

Closed
ARPasescu opened this issue Feb 5, 2019 · 3 comments · Fixed by #35083
Closed

S3TC image compression fails on exported project but works in editor #25640

ARPasescu opened this issue Feb 5, 2019 · 3 comments · Fixed by #35083

Comments

@ARPasescu
Copy link

Godot version: 3.0.6
OS: Windows 10 Pro

Issue description:
I'm trying to compress a viewport render image using S3TC, it works in the editor but not on the exported project, giving me this error.

image
image

This is my code:

yield(get_tree(), "idle_frame")
yield(get_tree(), "idle_frame")
var image = render_viewport.get_texture().get_data()
image.convert(Image.FORMAT_RGBA8)
image.compress(Image.COMPRESS_S3TC, Image.COMPRESS_SOURCE_GENERIC, 1.0) # Returns OK in editor but ERR_UNAVAILABLE on export
@ARPasescu ARPasescu changed the title Compressing an image using S3TC fails on exported project but works fine in editor S3TC image compression fails on exported project but works in editor Feb 8, 2019
@akien-mga akien-mga added this to the 3.1 milestone Feb 9, 2019
@akien-mga
Copy link
Member

S3TC compression is done via the squish module, and is indeed only enabled for the editor binary (TOOLS_ENABLED).

Previously the whole squish module was editor-only, but @eska014 exposed the decompress method in #24017. I guess the decompression stuff might also be exposed, but needs confirmation from @reduz that this would not cause issues.

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Feb 21, 2019
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Dec 13, 2019
akien-mga added a commit to akien-mga/godot that referenced this issue Jan 13, 2020
We already build Squish in templates build for S3TC decompression,
so we can as well expose the compression feature.

Fixes godotengine#25640.
@akien-mga akien-mga modified the milestones: 4.0, 3.2 Jan 13, 2020
@vrmaurice
Copy link

This error is happening again on Godot 4.1 Mono.

I'm trying to use the Image.Compress() method in C#, it gives this error:
ERROR: Condition "!_image_compress_bc_func" is true. Returning: ERR_UNAVAILABLE

I've built this for a Linux server, I run the server with the --headless flag.

4.1.1.stable.mono.official [bd6af8e]

@Calinou
Copy link
Member

Calinou commented Sep 11, 2023

I'm trying to use the Image.Compress() method in C#, it gives this error:

See this issue: #79932

Compressing textures to VRAM formats is not available in exported projects in 4.x for binary size reasons:

def can_build(env, platform):
return env.editor_build

We could expose a SCons option to enable VRAM compressors in non-editor builds (like #73003), but it'll require you to build custom export templates to use that feature.

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

Successfully merging a pull request may close this issue.

5 participants