Skip to content

Function: createPrimitiveMaterial() ​

ts
function createPrimitiveMaterial(params): ShaderMaterial;

Experimental

Default material for 2D/3D chart primitives: GLSL3 (in/out, declare out highp vec4 fragColor; in the fragment shader), straight (non-premultiplied) alpha blending, depth test on so 3D scenes occlude, depth write off so anti-aliased fringes never punch holes. Colors are written unconverted: inputs are already sRGB (see types.ts).

Parameters ​

ParameterType
params{ defines?: Record<string, string | number | boolean>; fragmentShader: string; uniforms: Record<string, IUniform>; vertexShader: string; }
params.defines?Record<string, string | number | boolean>
params.fragmentShaderstring
params.uniformsRecord<string, IUniform>
params.vertexShaderstring

Returns ​

ShaderMaterial

Released under the MIT License.