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

Bug: [v8] Compressed textures are not being rendered #10234

Open
ddenisyuk opened this issue Feb 21, 2024 · 6 comments
Open

Bug: [v8] Compressed textures are not being rendered #10234

ddenisyuk opened this issue Feb 21, 2024 · 6 comments
Assignees

Comments

@ddenisyuk
Copy link

Current Behavior

Raw compressed textures are not being rendered.
https://pixiplayground.com/#/edit/SaiCR3dMAPI85gObYWsYW

Expected Behavior

Compressed textures are rendered in the same way that PNG and WebP formats are.
https://pixiplayground.com/#/edit/uSKvABfoVBI1irklcDsf8

Steps to Reproduce

Try to load and render compressed texture

Environment

Possible Solution

No response

Additional Information

Additionally, in version 8:

  • DDS DX10 (parseDDS.ts) support has been dropped, and as result BC7 and BC6H are not supported.
  • KTX (not KTX2) support has been dropped.

Will v8 support those compressed texture containers in the future?

@GoodBoyDigital
Copy link
Member

heya! just to clarify, is this not working but meant to? Or is it that some older formats are no longer supported?
Thanks!

@ddenisyuk
Copy link
Author

Since I'm not aware of your plans for changes in version 8, I cannot be certain, but I expect it should work.

So I did few more tests, and here are my findings:

  1. Compressed textures are being rendered, but it requires manual registration:
    PIXI.extensions.add(PIXI.loadDDS, PIXI.loadKTX, PIXI.detectCompressed, PIXI.resolveCompressedTextureUrl);
    See jsfiddles: v7.4.0 vs v8.0.0-rc.10
  2. DDS DX10 works like a charm in v7, but not in v8 (because new implementation of parseDDS.ts, it looks not so hard to port support from v7):
Error: Unsupported texture format: DX10 undefined
    at Loader.ts:209:27
  1. KTX works well in version 8, but, for me, using a worker to extract raw bytes from the container seems like unnecessary overhead, especially since these are GPU-ready textures that do not require any transcoding. I would rather keep parseKTX.ts from version 7 for KTX and use a worker for KTX2. What do you think?

P.S.: For some reason v8.0.0-rc.10 example render black square in Safari v17.2, while v7.4.0 is ok, in the same time both tests on my local machine are ok.

@GoodBoyDigital
Copy link
Member

Thanks for your feedback. Compressed textures are not included by default, they can be included as a bundle. doing one of the following imports will add all the necessary extensions:

import 'pixi.js/dds' // adds and installs dds
import 'pixi.js/ktx' // adds and installs ktx
import 'pixi.js/basis' // adds and installs basis

Im cool with your suggestions, my thinking was that compression will play a big part of adoption for using them on the web - so wanted to make sure that was all covered.

Stacked at the mo, would certainly welcome PR's for adding back DDS DX10 and KTX containers! Up for the challenge? :D

@GoodBoyDigital
Copy link
Member

GoodBoyDigital commented Feb 22, 2024

@Zyie what would be the way to install the compressed texture bits when working with the bundle?

@Zyie
Copy link
Member

Zyie commented Feb 22, 2024

@Zyie what would be the way to install the compressed texture bits when working with the bundle?

I think this is a bug. The compression extensions should be automatically added when using the pre bundled version of the library. It seems that the code for everything is there, but the extensions.add calls are missing, will need to investigate

@Zyie Zyie self-assigned this Feb 23, 2024
@ddenisyuk
Copy link
Author

ddenisyuk commented Feb 23, 2024

Thanks for your feedback. Compressed textures are not included by default, they can be included as a bundle. doing one of the following imports will add all the necessary extensions:

import 'pixi.js/dds' // adds and installs dds
import 'pixi.js/ktx' // adds and installs ktx
import 'pixi.js/basis' // adds and installs basis

Im cool with your suggestions, my thinking was that compression will play a big part of adoption for using them on the web - so wanted to make sure that was all covered.

Stacked at the mo, would certainly welcome PR's for adding back DDS DX10 and KTX containers! Up for the challenge? :D

DDS DX10 - #10241
KTX - #10246

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

No branches or pull requests

3 participants