Giter VIP home page Giter VIP logo

Comments (7)

raysan5 avatar raysan5 commented on June 7, 2024

@aboeglin I'm testing the shared image and I get the following info about it, please could you confirm it is correct:

INFO: IMAGE: Data loaded successfully (1473x1473 | DXT5_RGBA | 1 mipmaps)

The image size looks a bit strange to me, please, could you try converting it to power-of-two?

Image and texture get loaded but I get a black image; I think the internally computed size could not be correct...

from raylib.

raysan5 avatar raysan5 commented on June 7, 2024

Definitely the issue is related to image not being POT, I tried to resize canvas to POT and now it loads correctly.
Could you test the attached file?
barbarian_scaled_to_pot.zip

from raylib.

aboeglin avatar aboeglin commented on June 7, 2024

@raysan5 yes correct, the provided image was compressed with DXT5. And your POT version does work although I'm pretty sure I tried that when exporting from texture packer already. Is it expected that non POT DXT compressed images can't be bound? Well given how the compression works it does make some sense but also I'd rather expect it to need to be like a multiple of 4 or something.

from raylib.

raysan5 avatar raysan5 commented on June 7, 2024

Is it expected that non POT DXT compressed images can't be bound?

Actually I'm not sure, I tried opening the DDS image with Paint.NET and it was able to open it but I don't know if there is some internal magic to convert it to POT or just decompress the image data on loading (raylib tries to load the compressed data as GPU compresed texture)... I reviewed the DDS loading code in raylib , and I couldn't see any issue with it, the information it gets from the DDS image header is actually the data used when trying to load it as a texture.

I'd also expect it to be, at least, multiple of 4 in size and 1473 it's not...

from raylib.

aboeglin avatar aboeglin commented on June 7, 2024

Actually it seems to work with non POT dimensions that are multiples of 4. Would it be complicated to report an error while loading the texture for DXT formats if it doesn't comply? I'm happy to look into it if given pointers.

from raylib.

raysan5 avatar raysan5 commented on June 7, 2024

Would it be complicated to report an error while loading the texture for DXT formats if it doesn't comply?

It could log some warning message if size is not multiple of 4 (point where you get that info from the file).

I'm investigating the issue and I think the data_size is not correctly calculated when image data is compressed. It needs to be reviewed more carefully. Here some reference code.

from raylib.

aboeglin avatar aboeglin commented on June 7, 2024

Should I try to open a PR to log a warning when the size isn’t a multiple of 4 for now until we try to see if we can make all sizes work?

from raylib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.