Comments (13)
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.
Hello, thanks for the heads up, I'll take a look and come back soon!
from notan.
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.
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.
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.
It makes sense, I am doing the change and 0.9.5
will be out this week. Thanks!
from notan.
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.
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.
Is the info returned by Graphics::limits() reliable for this?
https://docs.rs/notan/latest/notan/app/struct.Graphics.html#method.limits
from notan.
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.
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.
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.
Thanks!
from notan.
Related Issues (20)
- Use the CSS property `image-rendering: pixelated` when `antialias: false` HOT 1
- Error building notan_macro (Ubuntu 22.04.2 LTS) HOT 2
- Unresponsive window if using .vsync(true) on linux HOT 2
- DrawTransform matrix multiplication possibly in wrong order HOT 1
- Windows OS - Issue with scaling factor HOT 2
- Event::Exit is never triggered
- Elaborate the nine slicing example. HOT 1
- Allow users to select SubPixel precision drawing text. HOT 1
- Renderer slowing down from 0.8 to 0.9 version HOT 3
- Allow enable/disable `touch_as_mouse` at runtime. HOT 1
- Investigate cosmic-text and etagere used on glyphon to improve Text rendering support
- 0.9.5 EGUI Custom font example error HOT 2
- Allow to use Uniform Buffers across pipelines HOT 1
- Wayland + GNOME: WindowConfig::size() sets size incorrectly HOT 12
- Mouse scrolling issue HOT 2
- Clipboard not working on Linux x11 (i3wm) HOT 1
- Multisampling setting seems to be ignored HOT 2
- notan_draw docs won't build since 0.8.0 HOT 2
- `notan_graphics` depends on `image` when feature `texture_to_file` is disabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notan.