GithubHelp home page GithubHelp logo

Comments (13)

Quackdoc avatar Quackdoc commented on June 2, 2024

commenting here since I was not clear. the patch is used to allow notan to load the image directly. it doesn't fix the bug.

from notan.

Nazariglez avatar Nazariglez commented on June 2, 2024

Hello, thanks for the heads up, I'll take a look and come back soon!

from notan.

Nazariglez avatar Nazariglez commented on June 2, 2024

Well, your investigation at woelper/oculante#152 saved me a lot of time, thanks!

I did some changes (here) to allow loading any image no matter the size. And the issue we have with large texture is 99% because the texture is bigger than allowed by OpenGL. I added a warning to inform this. Although I am not sure how to manage this. There are some options:

  • Leave a warning, allowing to load the image even if it's displayed as a black rectangle.
  • Return an error when creating the texture. Forcing the dev to manage the error or panic.

My main worry is that this is not something that we can know at compilation time, with that kind of issue I am always prone to panic fast in debug mode. However this case depends on the user's hardware, a panic can be the worst for the user, and a warning log can be insufficient for the app's dev.

We can go for now with the warning (for 0.9.5) and change the behavior for 0.10.0, but I don't know what will be a good solution, to be honest...

Any thoughts?

from notan.

Quackdoc avatar Quackdoc commented on June 2, 2024

I think returning an error should be the appropriate solution. It would be best to let the application handle the error, this works well since a potential solution for this would be to tile textures until you have enough space to work with. returning the max size is certainly useful for this

from notan.

woelper avatar woelper commented on June 2, 2024

I also think an error would be best. In a game, I'd be forced to care about the texture and make sure it has the correct size. In Oculante's case we could either pass the error up or even decide to resize the texture on the fly and display a message.

from notan.

Nazariglez avatar Nazariglez commented on June 2, 2024

It makes sense, I am doing the change and 0.9.5 will be out this week. Thanks!

from notan.

woelper avatar woelper commented on June 2, 2024

Amazing, thank you so much! I will build a release for oculante afterwards, lots of other good things in 0.9.5, too!

from notan.

woelper avatar woelper commented on June 2, 2024

I did some more investigation, and at least on my system the texture limit is 16384x16384px. Is there any way in notan I can get the maximum supported texture size before loading fails? I am thinking of creating multiple textures or resizing the texture to fit before attempting to display it.

from notan.

riverfr0zen avatar riverfr0zen commented on June 2, 2024

Is the info returned by Graphics::limits() reliable for this?
https://docs.rs/notan/latest/notan/app/struct.Graphics.html#method.limits

from notan.

woelper avatar woelper commented on June 2, 2024

Thanks @riverfr0zen - I should have read the docs more thoroughly. This does exactly what I want and - at least in my case - returns the same value. I'll use that!

from notan.

Nazariglez avatar Nazariglez commented on June 2, 2024

Is the info returned by Graphics::limits() reliable for this? https://docs.rs/notan/latest/notan/app/struct.Graphics.html#method.limits

Yep, this is the value returned by the GL driver. Should be reliable.

from notan.

Nazariglez avatar Nazariglez commented on June 2, 2024

This should be done with the latest version on crates.io and the main branch, let me know otherwise, thanks for the help!

from notan.

woelper avatar woelper commented on June 2, 2024

Thanks!

from notan.

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.