inst/node_modules/mapbox-gl/src/shaders/README.md

Mapbox GL Shaders

This repository contains GL shaders which are shared by Mapbox GL JS and Mapbox GL Native.

Pragmas

Some variables change type depending on their context:

We abstract over this functionality using pragmas.

#pragma mapbox: define highp vec4 color

main() {
    #pragma mapbox: initialize highp vec4 color
    ...
    gl_FragColor = color;
}

This program defines a variable within main called color, initialize the value of color, then sets gl_FragColor to the value of color.

Pragmas take the following form.

#pragma mapbox: (define|initialize) (lowp|mediump|highp) (float|vec2|vec3|vec4) {name}

When using pragmas, the following requirements apply.

Util

The util.glsl file is automatically included in all shaders by the compiler.



rstudio/leaflet.mapboxgl documentation built on May 6, 2019, 8:30 p.m.