Namespaces

Variants
Actions

Gen Code Export GLSL

From Cycling '74 Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with " This page describes the export of GLSL source files with jit.gl.pix == Requirements == * Max 6.1 or later * For WebGL use, a [//caniuse.com/webgl WebGL compatible browser] ...")
 
Line 1: Line 1:
  
 
This page describes the export of GLSL source files with jit.gl.pix
 
This page describes the export of GLSL source files with jit.gl.pix
 +
 +
The referenced material is found here: [[Media:gl.pix.export.zip‎ ]]
  
 
== Requirements ==
 
== Requirements ==

Revision as of 17:48, 5 March 2013

This page describes the export of GLSL source files with jit.gl.pix

The referenced material is found here: Media:gl.pix.export.zip‎

Requirements

Exporting GLSL as a JXS File

JXS fles 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, exportcode 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