Love.js - A Direct Emscripten Port

Discuss any ports of LÖVE to different platforms.
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: Love.js - A Direct Emscripten Port

Post by Tanner »

Ulydev wrote:Just wanted to pass by and say a huge thanks for this project. Does it support shaders, and/or networking through sockets?
It supports OpenGL ES 2.0. Shaders have been tested and work. I haven't tested socket-based networking but emscripten definitely supports websockets so I would imagine that works as well.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Ulydev »

Tanner wrote:
Ulydev wrote:Just wanted to pass by and say a huge thanks for this project. Does it support shaders, and/or networking through sockets?
It supports OpenGL ES 2.0. Shaders have been tested and work. I haven't tested socket-based networking but emscripten definitely supports websockets so I would imagine that works as well.
Pinch me, it has to be a dream.
User avatar
gomez
Citizen
Posts: 65
Joined: Mon Feb 18, 2013 12:23 am
Location: Sao Luís, Brazil

Re: Love.js - A Direct Emscripten Port

Post by gomez »

Ulydev wrote:
Tanner wrote:
Ulydev wrote:Just wanted to pass by and say a huge thanks for this project. Does it support shaders, and/or networking through sockets?
It supports OpenGL ES 2.0. Shaders have been tested and work. I haven't tested socket-based networking but emscripten definitely supports websockets so I would imagine that works as well.
Pinch me, it has to be a dream.
It is real :awesome:
Hey dude :D
Do you want to protect earth from an apocalypse ? Me too o/
Check my new game here: viewtopic.php?f=5&t=81001
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Love.js - A Direct Emscripten Port

Post by slime »

FYI, websockets can only do TCP. So enet as well as luasocket's UDP APIs are out of the question (and TCP generally causes a lot of problems for action-oriented realtime games).
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Love.js - A Direct Emscripten Port

Post by bartbes »

Not just that, websockets aren't raw sockets either. They have a specific protocol.
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: Love.js - A Direct Emscripten Port

Post by Tanner »

What slime and bartbes are saying is true, of course, but I worry that it's more disheartening than it needs to be. For simple 2D games (AKA the majority of Love games) TCP websockets will performed quite well. Consider http://agar.io/.

Edit: A build was released today that fixed `love.audio.setVolume` and `love.audio.getVolume`. Also, I ported Mari0 which is, IMO, one of the best games ever made with Love. http://tannerrogalsky.com/mari0/
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Love.js - A Direct Emscripten Port

Post by josefnpat »

Tanner, you have outdone yourself once again!

http://50.116.63.25/public/getoffcat-lovejs/

Image

Image
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
unlimitedbacon
Prole
Posts: 6
Joined: Sun Dec 27, 2015 10:28 pm

Re: Love.js - A Direct Emscripten Port

Post by unlimitedbacon »

Tanner wrote:
Ulydev wrote:Just wanted to pass by and say a huge thanks for this project. Does it support shaders, and/or networking through sockets?
It supports OpenGL ES 2.0. Shaders have been tested and work. I haven't tested socket-based networking but emscripten definitely supports websockets so I would imagine that works as well.
It gets stuck for me on creating the first shader. My project:
https://github.com/unlimitedbacon/MiddleCommand

It stops on main.lua line 28. Not sure what else I can do to figure out whats going wrong.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Love.js - A Direct Emscripten Port

Post by bobbyjones »

unlimitedbacon wrote:
Tanner wrote:
Ulydev wrote:Just wanted to pass by and say a huge thanks for this project. Does it support shaders, and/or networking through sockets?
It supports OpenGL ES 2.0. Shaders have been tested and work. I haven't tested socket-based networking but emscripten definitely supports websockets so I would imagine that works as well.
It gets stuck for me on creating the first shader. My project:
https://github.com/unlimitedbacon/MiddleCommand

It stops on main.lua line 28. Not sure what else I can do to figure out whats going wrong.
OpenGles shaders are much more strict than Opengl shaders. You will have to double check that you are doing everything up to spec.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Love.js - A Direct Emscripten Port

Post by slime »

BobbyJones is right I think – in this case I believe the issue is this line in explosionShader.glsl:

Code: Select all

if (canvasPixel.r != 0 && canvasPixel.g != 0) {
In GLSL, integer numbers and floating-point numbers are two distinct types. Desktop GLSL will implicitly convert an integer literal to floating point when comparing with or assigning to a floating point variable, but GLSL ES (the OpenGL ES version of GLSL) won't.

To fix it, change that line to this in order to make the literal numbers a floating point type:

Code: Select all

if (canvasPixel.r != 0.0 && canvasPixel.g != 0.0) {
As a side note, you can pass a filepath directly into love.graphics.newShader and it will load it. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests