Shader - noobgl/noobgl GitHub Wiki

The shader is the main things that defines where vertices are going to be drawn and how they look like.

Import

import { Shader } from "noobgl";

Constructor

new Shader(context, vertexSource, fragmentSource);
  • context the WebGL2 context of a canvas.
  • vertexSource a string containing the vertex shader program.
  • fragmentSource a string containing the fragment shader program.

Properties

.context the context the shader use to transfer and compile.

.vertex the native vertex shader instance initiated with the context.

.fragment the native fragment shader instance initiated with the context.

Methods

.delete()

Delete the vertex and the fragment shader.