ShaderStage

View source

Identifies the stage represented by shader source.

Examples

import { Shader, ShaderStage } from '@wimaengine/render-core'

const vertexShader = new Shader(ShaderStage.Vertex, vertexSource)
const fragmentShader = new Shader(ShaderStage.Fragment, fragmentSource)

Variants


Vertex

View source

Vertex-shader stage, represented by WebGL’s VERTEX_SHADER value.

WebGL compiles this source for the vertex stage when the value is passed to gl.createShader.

Fragment

View source

Fragment-shader stage, represented by WebGL’s FRAGMENT_SHADER value.

WebGL compiles this source for the fragment stage when the value is passed to gl.createShader.