offsetToCoords() {
        const funcName = 'offsetToCoords';
        return {
            offsetToCoords: new glsl_definitions_1.GlslLibRoutine(`
      vec2 ${funcName}(int offset, int width, int height) {
        int t = offset / width;
        int s = offset - t*width;
        vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);
        return coords;
      }
      `)
        };
    }
/**
     * Produces a function that can map from
     * 2D normalzied coordinates (s,t) to a flat offset
     */
Produces a function that can map from
2D normalzied coordinates (s,t) to a flat offset
Produces a function that can map from 2D normalzied coordinates ( s t ) to a flat offset
offsetToCoords() {
        const funcName = 'offsetToCoords';
        return {
            offsetToCoords: new glsl_definitions_1.GlslLibRoutine(`
      vec2 ${funcName}(int offset, int width, int height) {
        int t = offset / width;
        int s = offset - t*width;
        vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);
        return coords;
      }
      `)
        };
    }
offsetToCoords ( ) { const funcName = 'offsetToCoords' ; return { offsetToCoords : new glsl_definitions_1 . GlslLibRoutine ( ` ${ funcName } ` ) } ; }
Produces a function that can map from
 2D normalzied coordinates (s,t) to a flat offset
Produces a function that can map from 2D normalzied coordinates ( s t ) to a flat offset