3 Short Questions About "Swiftshader" Support In NW.js

229 views
Skip to first unread message

dannyy...@googlemail.com

unread,
Apr 1, 2018, 12:09:40 PM4/1/18
to nw.js
Hello NW.js Team!
I've recently noticed that NW.js has support for something called "Swiftshader" (Link). I understand the basics behind it and I would like to make use of it in my HTML5 games.
Below are some questions, I'd really appreciate an official response:
  1. How do I make use of it? (Chromium arg, Javascript, 3rd party files required?)
  2. Does it come with any downsides in comparison to not using it at all?
  3. The blog post says that support has been added for Windows and Linux, does this mean that OSX (Mac) is not supported?

Cheers!
Message has been deleted

Roger

unread,
Apr 3, 2018, 3:43:34 AM4/3/18
to dannyy...@googlemail.com, nw.js
Besides Ervin's answer I'd like to add that:

1. Just keep the files under the swiftshader directory when you package it. It enables 3D contents on incapable GPUs.
2. If your app has 3D contents, you may want to use it because your application will be able to run on more hardware configurations. In terms of this capability improvement there are no downsides.
3. According to Chrome developer: "GPU and driver support on the mac has proven to be really solid so I'm afraid that providing a software rasterizer on that platform isn't high on our list of priorities." -- https://bugs.chromium.org/p/chromium/issues/detail?id=127813#c2

Roger

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dannyy...@googlemail.com

unread,
Apr 3, 2018, 8:35:52 AM4/3/18
to nw.js
Thanks a lot for responding.

I'm mainly interested in improvements for 2D games (made with Construct 2). Currently NW.js Desktop exports in Construct 2 don't include Swiftshader and I was interested in contacting the engine developer about adding support for it. Seems like builds on nwjs.io already have all the files required so I guess the engine developer is manually removing those for unknown reasons. That's why I wanted to find out if there are any downsides that could've lead to his decision to do so.
Message has been deleted

Roger

unread,
Apr 3, 2018, 9:18:17 PM4/3/18
to Ervin Kosch, nw.js
Swiftshader is shipping by default within the Google Chrome browser on Windows and Linux. It's not in alpha or beta state. It will be enabled automatically when it's needed with incapable GPUs, which can be checked with navigating to 'chrome://gpu'.

On Wed, Apr 4, 2018 at 6:33 AM Ervin Kosch <ervin...@gmail.com> wrote:
Swiftshader is side project that Google is doing. Its not directly included in Chrome yet because it really in early in a late alpha/early beta state. Right now it's just plugin. It was link on one of the documents I included. Also it's targeted at 3D, not so much 2D. So I'm not sure how much it will help with a Construct 2 or 3 project.

https://swiftshader.googlesource.com/SwiftShader


Usage

The SwiftShader libraries act as drop-in replacements for graphics drivers.

On Windows, most applications can be made to use SwiftShader's DLLs by placing them in the same folder as the executable. On Linux, the LD_LIBRARY_PATH environment variable or -rpath linker option can be used to direct applications to search for shared libraries in the indicated directory first.

Prebuilt binaries can be found at: https://goo.gl/5MOcdb

--

Ervin Kosch

unread,
Apr 4, 2018, 3:14:02 AM4/4/18
to nw.js
I think you have a bit of a misunderstanding.  NWJS is not built from Chrome.  It's built from Chromium.  The difference is that Chromium only contains completely open sourced libraries. That is why for certain video playback on NWJS you have to add a open source libraries to the project that may make you entire project into linces that will not let you profit from your work.   This maybe the same issue here of questionable licenses.  

I would say copy the DLL in the same folder as the NWJS exe and try it.  The worse that happens is that you loose 10 minutes in your life.


FYI: just so that you don't think I'm blow smoke up your tail pipe:

Enable Proprietary Codecs

Using MP3 & MP4 (H.264) using the video & audio tags. (Older versions of NWJS but still relevant)

To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general+unsubscribe@googlegroups.com.

Roger

unread,
Apr 4, 2018, 4:29:57 AM4/4/18
to Ervin Kosch, nw.js
You are right that NW is built on Chromium. But regarding redistributing swiftshader, there is no difference between Chrome and Chromium. Swiftshader is included in the distribution in both of them.

Roger

To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
Message has been deleted
Message has been deleted

dannyy...@googlemail.com

unread,
Apr 4, 2018, 8:12:32 AM4/4/18
to nw.js
Thanks for all the responses and information!

I think it's clear now that there is no reason to manually remove Swiftshader even if it's just for 2D games and I will contact the engine developer about adding support for this feature.

burnsto...@gmail.com

unread,
Nov 12, 2018, 7:03:03 AM11/12/18
to nw.js
Hi guys, I just want to clarify for everyone looking up this (like I just was 3 minutes ago):
  • Construct 2 uses NW.js as build target
  • Construct 2 is a 2D engine that uses WebGL for rendering
  • Construct 2 currently does not use NW.js with SwiftShader, and it should (I guess)
Reply all
Reply to author
Forward
0 new messages