MCPcopy
hub / github.com/processing/p5.js / _webGL2CompatibilityPrefix

Method _webGL2CompatibilityPrefix

src/webgl/p5.RendererGL.js:873–887  ·  view source on GitHub ↗
(shaderType, floatPrecision)

Source from the content-addressed store, hash-verified

871 }
872
873 _webGL2CompatibilityPrefix(shaderType, floatPrecision) {
874 let code = "";
875 if (this.webglVersion === constants.WEBGL2) {
876 code += "#version 300 es\n#define WEBGL2\n";
877 }
878 if (shaderType === "vert") {
879 code += "#define VERTEX_SHADER\n";
880 } else if (shaderType === "frag") {
881 code += "#define FRAGMENT_SHADER\n";
882 }
883 if (floatPrecision) {
884 code += `precision ${floatPrecision} float;\n`;
885 }
886 return code;
887 }
888
889 /*
890 * WebGL-specific implementation of imageLight shader creation

Callers 7

_getLightShaderMethod · 0.95
_getNormalShaderMethod · 0.95
_getColorShaderMethod · 0.95
_getLineShaderMethod · 0.95
_getFontShaderMethod · 0.95
baseFilterShaderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected