Comments (4)
Hey @reformat0r !
Sorry for the late response. The App struct contains some time information.
app.timer.delta_f32()
->f32
app.timer.delta()
->Instant
app.timer.init_time()
->Instant
You can use the delta to calculate your uniforms, or if you want, you can check the init time or the delta to avoid draw to the GPU some frames.
from notan.
Nice!
- Do you think the framework should provide a way for the user to set the target (max) FPS?
- Should I change the examples such that they use the delta-function to compute the uniforms? Otherwise people might wonder why they don't exhibit consistent behavior...
from notan.
I think it's a good idea to provide a way to limit the frames. Let me think about it a little because it's possible to do this with a plugin, but it will need some changes in how the app loop works probably (to be sure that the delta times are right).
Said that I think that it's also a good idea to use the delta time to set the values of the uniforms or any other value that creates animation. Just to avoid weird visual glitches if the frame is not always the same.
from notan.
This is done in the main
branch right now. If you're loading the types using notan::prelude::*
you can just use .add_plugin(FpsPlugin::new(60))
to use the plugin.
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
- Large image files load to black texture HOT 13
- 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 2
- 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 11
- 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.