[page:Material] →

[name]

Material rendered with custom shaders

Constructor

[name]([page:Object parameters])

parameters -- An object containing various parameters setting up shaders and their uniforms.

Example:

uniforms = { time: { type: "f", value: 1.0 }, resolution: { type: "v2", value: new THREE.Vector2() } }; material = new THREE.ShaderMaterial( { uniforms: uniforms, vertexShader: document.getElementById( 'vertexShader' ).textContent, fragmentShader: document.getElementById( 'fragmentShader' ).textContent } );

Properties

.[page:object uniforms]

Uniforms defined inside GLSL shader code.

.[page:string fragmentShader]

Fragment shader GLSL code. This is the actual code for the shader. In the example above the code is retrieved from DOM elements emnbedded directly in the page although other methods can be used including specifying a string directly.

.[page:string vertexShader]

Vertex shader GLSL code. This is the actual code for the shader. In the example above the code is retrieved from DOM elements embedded directly in the page although other methods can be used including specifying a string directly.

.[page:boolean morphTargets]

todo

.[page:boolean lights]

todo

.[page:boolean morphNormals]

todo

.[page:boolean wireframe]

todo

.[page:number vertexColors]

todo

.[page:boolean skinning]

todo

.[page:boolean fog]

todo

.[page:object attributes]

todo

.[page:number shading]

todo

.[page:number linewidth]

todo

.[page:number wireframeLinewidth]

todo

.[page:object defines]

todo

Methods

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]