Difference between revisions of "GLES Shader Testing in Desktop"

(GLSLES shader testing in desktop)
 
m (Where to place the ANGLE DLLs?)
Line 9: Line 9:
 
You need GPU which supports OpenGLES context. As previously written, todays desktop GPU should support this.
 
You need GPU which supports OpenGLES context. As previously written, todays desktop GPU should support this.
  
If your GPU doesn't supports it, you might can use [https://chromium.googlesource.com/angle/angle ANGLE]. If you're under Windows, you can actually run LOVE using only DirectX 9 capable GPU by using ANGLE (you can grab the DLLs from your Google Chrome installation, named <code>libegl.dll</code> and <code>libopenglesv2.dll</code>. Just make sure it's 32-bit DLLs if you're using 32-bit version of LOVE (same also for 64-bit)).
+
If your GPU doesn't supports it, you might can use [https://chromium.googlesource.com/angle/angle ANGLE]. If you're under Windows, you can actually run LOVE using only DirectX 9 capable GPU by using ANGLE (you can grab the DLLs from your Google Chrome or Firefox installation, named <code>libegl.dll</code> and <code>libopenglesv2.dll</code>. Just make sure it's 32-bit DLLs if you're using 32-bit version of LOVE (same also for 64-bit) and place it beside <code>love.exe</code>).
  
 
== Tell LOVE to use OpenGLES context ==
 
== Tell LOVE to use OpenGLES context ==

Revision as of 14:10, 4 January 2018

Writing shaders to support mobile devices might be not trivial. You may wondering is there a way to test shader in mobile devices without really using mobile device.

The answer is yes, there's a way.

Desktop GPU nowadays (even integrated one) should supports creating OpenGLES context, which means all shaders must be GLSLES/ESSL compatible. We can make LOVE to use OpenGLES context by using environment variable LOVE_GRAPHICS_USE_OPENGLES=1.

Requirements

You need GPU which supports OpenGLES context. As previously written, todays desktop GPU should support this.

If your GPU doesn't supports it, you might can use ANGLE. If you're under Windows, you can actually run LOVE using only DirectX 9 capable GPU by using ANGLE (you can grab the DLLs from your Google Chrome or Firefox installation, named libegl.dll and libopenglesv2.dll. Just make sure it's 32-bit DLLs if you're using 32-bit version of LOVE (same also for 64-bit) and place it beside love.exe).

Tell LOVE to use OpenGLES context

Now, we need to tell LOVE to use OpenGLES context. You need to set this environment variable before starting LOVE. It can be set using Command Prompt/Terminal and launching LOVE from same Terminal, or from Windows, from Advanced System Settings.

  • Windows: set LOVE_GRAPHICS_USE_OPENGLES=1 then lovec ... (this assume 0.10.2 used)
  • Linux/macOS: LOVE_GRAPHICS_USE_OPENGLES=1 love ...

Verify if LOVE uses OpenGLES context by calling love.graphics.getRendererInfo and check if the 1st return value is "OpenGL ES".

Once you got OpenGLES context, you can test your shader code if it works under mobile devices.