Page 3 of 23

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 08, 2016 7:38 pm
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.

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 08, 2016 7:39 pm
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.

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 08, 2016 9:41 pm
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:

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 08, 2016 10:23 pm
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).

Re: Love.js - A Direct Emscripten Port

Posted: Tue Feb 09, 2016 9:52 am
by bartbes
Not just that, websockets aren't raw sockets either. They have a specific protocol.

Re: Love.js - A Direct Emscripten Port

Posted: Tue Feb 09, 2016 5:49 pm
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/

Re: Love.js - A Direct Emscripten Port

Posted: Sun Feb 14, 2016 7:34 pm
by josefnpat
Tanner, you have outdone yourself once again!

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

Image

Image

Re: Love.js - A Direct Emscripten Port

Posted: Sun Feb 14, 2016 11:38 pm
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.

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 15, 2016 12:45 am
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.

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 15, 2016 1:34 am
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. :)