Comments (8)
Hello @coltonoscopy , thanks for opening an issue!
I have noticed this too a while back, when making a LÖVE-to-web tool.
It seems related to love.js, as it was reported in this forum thread. Basically, canvases have artifacts on some GPUs (for example MacBook and iPad).
You can check this for yourself in this example. On the left are particles rendered with canvas, and on the right without canvas.
For a temporary fix, you might want to disable the use of canvases in push (canvas = false). I haven’t tried this myself, but it should work :-)
from push.
Hey @Ulydev, thank you so much for the fast response! :) I'm indeed on a Macbook, and the canvas = false
flag in the config options fixes the problem (or at least masks it) for now! Since it's not an issue with push
itself, I'll close :) Thanks again!!
btw I'm using your library for all of the games I use in a course I teach at Harvard on game dev (cs50.github.io/games); really an amazing library. Thank you for making it and maintaining it! :D
from push.
@coltonoscopy, you're welcome!
Thank you for using my library in your course, I really appreciate it :-)
from push.
@Ulydev all thanks go to you! :) Really makes teaching in the context of retro-style games much easier!
from push.
@Ulydev PS, given your experience with love.js
, happen to know what might cause performance issues for games in the browser that run perfectly fine (60 FPS) natively? a la the following simple Super Mario clone?
Original repo (mario
subfolder): https://github.com/games50/mario
Live deployment: https://coltonoscopy.github.io/mario-love-emscripten/
from push.
Hello @coltonoscopy, sorry for the delay.
There indeed seems to be a performance issue in the love.js version of your game. I must admit it's been a while since I used LÖVE, but here are some first guesses.
First, try the release-performance release type of love.js - it makes it harder to debug, but could also improve performance.
Also, I suggest you use LÖVE's SpriteBatches for tile-based games. In my experience, it makes a huge difference when there are many draw calls. For instance, Mari0 uses it, and even the love.js version runs pretty smoothly on my laptop.
Good luck! Please let me know if you have any other questions
from push.
Hey @Ulydev, thanks so much for the response! I'll try both of those techniques. Offhand, do you know what would cause performance differences between love.js and native LÖVE in the context of draw calls such that a SpriteBatch would indeed make such a difference on the same machine? Does WebGL suffer more from that particular bottleneck?
from push.
Hello @coltonoscopy,
That's a great question, I wish I was experienced enough to answer it correctly. I'm not sure draw calls are the only thing that make a difference when porting to the web. It could be due, more generally, to the way Lua code is interpreted in the browser.
My suggestion about SpriteBatches was just a guess, as it is one of the most efficient improvements I noticed when I first started using tile maps with LÖVE. The fact that in general, WebGL is slower than native OpenGL makes it possible that reducing the amount of draw calls improves performance.
Your question made me wonder if there's some kind of benchmark that measures regular Lua usage vs. love.graphics draw calls. One could run them both in native and web environments and see where is the biggest difference in performance.
I'll be sure to let you know if there's such a thing - or if I end up making one. Thanks!
from push.
Related Issues (20)
- white screen HOT 3
- Push:finish() Shader Processing After window resize or fullscreen mode HOT 4
- Properly scale love.graphics.circle? HOT 2
- Background color HOT 1
- Love 11.2 Issues HOT 3
- push:toGame return value HOT 1
- memory usage steadily increases when using canvases
- : bad argument #2 to 'windowUpdateMode' (number expected, got nil) HOT 8
- Resizing window also resizes internal cavases
- Error push.lua:48 : bad argument # 2 to 'windowUpdateMode'(number expected, got table) HOT 5
- Error HOT 1
- error at 135 HOT 4
- Error when running love, any help? HOT 2
- toReal function creates global variables HOT 1
- Canvas Transformations not Preserved when Drawn in Update()
- Setting window width/height to 0 in push:setupScreen causes blank screen HOT 2
- Performance is terrible on Android if canvas flag = true
- push:setupScreen makes the program close HOT 5
- Black bars problem and windowed mode broken
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 push.