Module: shaderHelper

Simplified creation of Shader Material for CS559 Framework

The "shaderMaterial" function creates a THREE shader material given URLs for the vertex and fragment shader.

It work asynchronously - it gives simple shaders until the real ones load.

There are potentially issues if the fragment shader ends up getting compiled before the vertex shader.

Source:

Methods

(static) shaderMaterial(vertexShaderURL, fragmentShaderURL, propertiesopt) → {THREE.ShaderMaterial}

Create a Shader Material from a set of shader files Creates the material with default shaders, and async loads the shaders from file and swaps them in when they are ready.

Parameters:
Name Type Attributes Description
vertexShaderURL string
fragmentShaderURL string
properties THREE.ShaderMaterialParameters <optional>
Source:
Returns:
Type
THREE.ShaderMaterial

(inner) loadFragmentShader(url, material)

Parameters:
Name Type Description
url string
material THREE.ShaderMaterial
Source:

(inner) loadVertexShader(url, material)

Parameters:
Name Type Description
url string
material THREE.ShaderMaterial
Source: