Giter Site home page Giter Site logo

Pixellation using push with love.js about push HOT 8 CLOSED

ulydev avatar ulydev commented on August 29, 2024
Pixellation using push with love.js

from push.

Comments (8)

Ulydev avatar Ulydev commented on August 29, 2024

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.

coltonoscopy avatar coltonoscopy commented on August 29, 2024

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.

Ulydev avatar Ulydev commented on August 29, 2024

@coltonoscopy, you're welcome!
Thank you for using my library in your course, I really appreciate it :-)

from push.

coltonoscopy avatar coltonoscopy commented on August 29, 2024

@Ulydev all thanks go to you! :) Really makes teaching in the context of retro-style games much easier!

from push.

coltonoscopy avatar coltonoscopy commented on August 29, 2024

@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.

Ulydev avatar Ulydev commented on August 29, 2024

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.

coltonoscopy avatar coltonoscopy commented on August 29, 2024

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.

Ulydev avatar Ulydev commented on August 29, 2024

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)

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.