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

[OpenGL] Failing to load DXT1 textures with OpenGL renderer #1777

Open
Neloreck opened this issue Jan 25, 2025 · 3 comments
Open

[OpenGL] Failing to load DXT1 textures with OpenGL renderer #1777

Neloreck opened this issue Jan 25, 2025 · 3 comments
Labels
Bug The issue in the run-time. External (3rd party) This issue is related to external component used by our project. Modmaker Experience Modmaker experience with OpenXRay OpenGL Renderer

Comments

@Neloreck
Copy link
Contributor

Neloreck commented Jan 25, 2025

Describe the bug

Assertion from GLI library is failing when try to load some textures from anomaly mod. Seems like particles/weapons are using DXT1 without alpha channel for optimal space usage (wpn_gauss.dds 682kb instead of original 1366kb).

Everything is OK with other renderers.
Original GLI is not updated for ages, unfortunately externals fork does not seem alive too so reporting it here.

To Reproduce

  • Try using provided gauss textures
  • Use mixed build + openGL renderer
  • Start game
  • Get breakpoint on assertion (link)

Expected behavior

  • No failures with openGL renderer
  • Clearly not all the data is copied later with std::memcpy

Screenshots, videos

24kb are lost somewhere

Image

Since header/header10 parts are read and game works on assertion comment, It feels like something is missing in this calculation approximation, but I am not familiar with renderer logics:
this->GlobalMemorySize = Storage.layer_size(BaseFace, MaxFace, BaseLevel, MaxLevel) * Layers;

wpn_gauss.zip

@Neloreck Neloreck added the Bug The issue in the run-time. label Jan 25, 2025
@Neloreck
Copy link
Contributor Author

Neloreck commented Feb 9, 2025

Tried to play around with same texture - converted it / inspected. Seems like missing 20 bytes are part of header10 data struct which is marked as null in anomaly textures.

Data counting (layers, minmaps etc) is correct, so this part is OK
this->GlobalMemorySize = Storage.layer_size(BaseFace, MaxFace, BaseLevel, MaxLevel) * Layers;

Converting from D3D to DXGI fixed missing data problem, so I am not sure whether

  • Assertion in GLI is wrong, but data is marked OK. Other renderers are OK without crashes, rust lib I used for reading/converting did not fail too
  • These textures are incorrectly converted and incorrectly mark/reserve data for header10

Anomaly/CoC just do not care about such issue because OpenGL renderer is not used and this assertion does not cause any problems

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Feb 9, 2025

DDS format (especially DX9 one, but DX10 also, in it's earliest times) has many quirks because different vendors/implementations could make their changes to the format.
I'm leaning towards using DirectXTex for OpenGL renderer as well, because DirectXTex supports and can handle various quirks.

@Xottab-DUTY Xottab-DUTY added Renderer Modmaker Experience Modmaker experience with OpenXRay External (3rd party) This issue is related to external component used by our project. OpenGL labels Feb 9, 2025
@Xottab-DUTY
Copy link
Member

This issue is also somewhat related with #545.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue in the run-time. External (3rd party) This issue is related to external component used by our project. Modmaker Experience Modmaker experience with OpenXRay OpenGL Renderer
Projects
Status: No status
Development

No branches or pull requests

2 participants