Skip to content

Instantly share code, notes, and snippets.

@sasha240100
Last active August 9, 2018 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasha240100/17f3b2ae7551b05faff20ed994cb4af0 to your computer and use it in GitHub Desktop.
Save sasha240100/17f3b2ae7551b05faff20ed994cb4af0 to your computer and use it in GitHub Desktop.
FXGL features list

Problem

WebGL2 is not backwards-compatible with WebGL. You have to use #version 300 es shaders that have different structure (as different GLSL version):

Ex1. WebGL1 GLSL (vertex):

attribute vec3 position;

void main() {
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}

Ex2. WebGL2 GLSL (vertex):

in vec3 position;
out vec4 myOutputPosition;

void main() {
  myOutputPosition = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}

Therefore, great Webgl1 engines can't be moved to Webgl2 without rewriting their core. And because of that some of them decided to not to move to Webgl2 (as regl did), or to just implement it particularly (as Three.js did).

Purpose

To make a lightweight WebGL2-only library that will support Tree-shaking (as Three.js doesn't), modular workflow and other features in the list:

  • MSDF shadows. MSDF explanation
  • ShaderBuilder: compile shaders on the go from multiple chunks.
  • Extended shader library with physically-based rendering utils & bigger shader chunks collection.
  • (possible) Raytrace renderer.
  • Easier framebuffers workflow.
  • Easier work with textures
  • Semi-procedural way of framebuffers/textures processing. (aka super-simple effect composer)
  • 3D textures support
  • Enhanced particle systems API. (That makes it easier to integrate particles with physics engines like particulate.js
  • TODO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment