Gen Code Export: GLSL


    Following are the steps for the export of GLSL source files with jit.gl.pix.

    Requirements

    Max 6.1 or later
    For WebGL use, a WebGL compatible browser

    Exporting GLSL as a JXS File

    JXS files are GLSL source code marked up with XML tags. They are used by jit.gl.shader and jit.gl.slab for loading GLSL and other shader code. jit.gl.pix exports GLSL as JXS files, which can be read directly by jit.gl.slab.
    1. Open a jit.gl.pix patch to be exported
    2. Send jit.gl.pix the exportcode message
    3. Load the exported JXS file into a jit.gl.slab
    WebGL (and OpenGL ES) have different capabilities as compared to standard OpenGL. When using shaders, you must provide much of the OpenGL state that is provided for free in desktop OpenGL. As a result, the structure of exported shaders needs to be a bit different in order to function properly in WebGL and OpenGL ES contexts. To export jit.gl.pix patchers for WebGL, the exportcode message takes an optional argument specifying which GLSL target to export for. The steps for exporting for WebGL are:
    1. Open a jit.gl.pix patch to be exported
    2. Send jit.gl.pix the exportcode webjxs message
    3. Load the exported JXS file into a jit.gl.slab