Phaser API Documentation

  Version: 
createProgram(vertexShader, fragmentShader)

Description:

Creates a WebGLProgram instance based on the given vertex and fragment shader source.

Then compiles, attaches and links the program before returning it.

Parameters:

name type description
vertexShader string

The vertex shader source code as a single string.

fragmentShader string

The fragment shader source code as a single string.

Returns:
Description:

The linked WebGLProgram created from the given shader source.

Type:
  • WebGLProgram
Examples:
Since: 3.0.0