ShaderMaterial

THREE.ShaderMaterial
See theShaderMaterial companion object
class ShaderMaterial(parameters: UndefOr[Object]) extends Material

A material rendered with custom shaders. A shader is a small program written in GLSL that runs on the GPU. You may want to use a custom shader if you need to implement an effect not included with any of the built-in materials.

Attributes

Companion
object
Graph
Supertypes
class Material
class Object
trait Any
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Value members

Inherited methods

def copy(material: Material): this.type

Attributes

Inherited from:
Material
def customProgramCacheKey(): String

Attributes

Inherited from:
Material
def dispose(): Unit

Attributes

Inherited from:
Material
def hasOwnProperty(v: String): Boolean

Attributes

Inherited from:
Object
def isPrototypeOf(v: Object): Boolean

Attributes

Inherited from:
Object
def jsClone(): this.type

Attributes

Inherited from:
Material
def onBeforeCompile(shader: Object): Unit

Attributes

Inherited from:
Material
def propertyIsEnumerable(v: String): Boolean

Attributes

Inherited from:
Object
def setValues(values: Object): Unit

Attributes

Inherited from:
Material
def toLocaleString(): String

Attributes

Inherited from:
Object
def valueOf(): Any

Attributes

Inherited from:
Object

Concrete fields

var clipping: Boolean

Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform.

Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform.

Attributes

When the rendered geometry doesn't include these attributes but the material does, these default values will be passed to the shaders.

When the rendered geometry doesn't include these attributes but the material does, these default values will be passed to the shaders.

Attributes

var defines: Object

Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive.

Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive.

Attributes

var extensions: Object

This object allows to enable certain WebGL 2 extensions.

This object allows to enable certain WebGL 2 extensions.

Attributes

var fog: Boolean

Defines whether the material color is affected by global fog settings; true to pass fog uniforms to the shader.

Defines whether the material color is affected by global fog settings; true to pass fog uniforms to the shader.

Attributes

var fragmentShader: String

Fragment shader GLSL code. This is the actual code for the shader.

Fragment shader GLSL code. This is the actual code for the shader.

Attributes

var glslVersion: Object

Defines the GLSL version of custom shader code.

Defines the GLSL version of custom shader code.

Attributes

var index0AttributeName: UndefOr[String]

If set, this calls gl.bindAttribLocation to bind a generic vertex index to an attribute variable.

If set, this calls gl.bindAttribLocation to bind a generic vertex index to an attribute variable.

Attributes

val isShaderMaterial: Boolean

This flag can be used for type testing.

This flag can be used for type testing.

Attributes

var lights: Boolean

Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader.

Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader.

Attributes

var linewidth: Double

Controls line thickness for lines.

Controls line thickness for lines.

Attributes

var uniforms: Object

An object specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform.

An object specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform.

Attributes

var uniformsGroups: Array[Object]

An array holding uniforms groups for configuring UBOs.

An array holding uniforms groups for configuring UBOs.

Attributes

var uniformsNeedUpdate: Boolean

Can be used to force a uniform update while changing uniforms in onBeforeRender.

Can be used to force a uniform update while changing uniforms in onBeforeRender.

Attributes

var vertexShader: String

Vertex shader GLSL code. This is the actual code for the shader.

Vertex shader GLSL code. This is the actual code for the shader.

Attributes

var wireframe: Boolean

Renders the geometry as a wireframe.

Renders the geometry as a wireframe.

Attributes

var wireframeLinewidth: Double

Controls the thickness of the wireframe.

Controls the thickness of the wireframe.

Attributes

Inherited fields

val `type`: String

Attributes

Inherited from:
Material
var alphaTest: Double

Attributes

Inherited from:
Material
var alphaToCoverage: Boolean

Attributes

Inherited from:
Material
var blending: Int

Attributes

Inherited from:
Material
var depthTest: Boolean

Attributes

Inherited from:
Material
var depthWrite: Boolean

Attributes

Inherited from:
Material
val id: Int

Attributes

Inherited from:
Material
var name: String

Attributes

Inherited from:
Material
var opacity: Double

Attributes

Inherited from:
Material
var polygonOffset: Boolean

Attributes

Inherited from:
Material
var polygonOffsetFactor: Double

Attributes

Inherited from:
Material
var polygonOffsetUnits: Double

Attributes

Inherited from:
Material
var precision: UndefOr[String]

Attributes

Inherited from:
Material
var premultipliedAlpha: Boolean

Attributes

Inherited from:
Material
var side: Int

Attributes

Inherited from:
Material
var stencilWrite: Boolean

Attributes

Inherited from:
Material
var toneMapped: Boolean

Attributes

Inherited from:
Material
var transparent: Boolean

Attributes

Inherited from:
Material
var userData: Object

Attributes

Inherited from:
Material
val uuid: String

Attributes

Inherited from:
Material
var version: Int

Attributes

Inherited from:
Material
var vertexColors: Boolean

Attributes

Inherited from:
Material
var visible: Boolean

Attributes

Inherited from:
Material