MCPcopy Index your code
hub / github.com/processing/p5.js / _createImageLightShader

Method _createImageLightShader

src/webgl/p5.RendererGL.js:892–911  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

890 * WebGL-specific implementation of imageLight shader creation
891 */
892 _createImageLightShader(type) {
893 if (type === 'diffused') {
894 return new Shader(
895 this,
896 this._webGL2CompatibilityPrefix("vert", "highp") +
897 defaultShaders.imageLightVert,
898 this._webGL2CompatibilityPrefix("frag", "highp") +
899 defaultShaders.imageLightDiffusedFrag
900 );
901 } else if (type === 'specular') {
902 return new Shader(
903 this,
904 this._webGL2CompatibilityPrefix("vert", "highp") +
905 defaultShaders.imageLightVert,
906 this._webGL2CompatibilityPrefix("frag", "highp") +
907 defaultShaders.imageLightSpecularFrag
908 );
909 }
910 throw new Error(`Unknown imageLight shader type: ${type}`);
911 }
912
913
914 /*

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected