crashinvaders / gdx-vfx

libGDX post-processing visual effects
https://crashinvaders.github.io/gdx-vfx
Apache License 2.0
191 stars 25 forks source link

Fix effects not rendering when OpenGL 3.x is used #10

Closed Anuken closed 4 years ago

Anuken commented 4 years ago

When OpenGL 3.x is enabled, effects (and sometimes even the whole buffer) are not displayed.

Steps to reproduce

  1. Open DesktopLauncher.java in the demo source.
  2. Add the line: config.useOpenGL3(true, 3, 0); (3, 2 will cause the same issue)
  3. Run the demo. Add some effects. Observe that when an odd amount of effects is added, nothing is rendered. When the amount is even, the buffer is shown, but the affects are not applied.

The Cause

ViewportQuadMesh uses VertexDataType.VertexArray, which is not supported on OpenGL 3.x. Removing the explicit data type specification makes the Mesh choose its own data type based on the type of OpenGL available.

metaphore commented 4 years ago

A good one, thanks a lot!