Dart DocumentationthreeShaderMaterial

ShaderMaterial class

class ShaderMaterial extends Material {

 String fragmentShader;
 String vertexShader;
 Map<String, Uniform> uniforms;

 //var attributes; - Moved to Material

 int shading;

 bool wireframe;
 num wireframeLinewidth;


 bool lights; // set to use scene lights

 bool skinning; // set to use skinning attribute streams

 bool morphTargets; // set to use morph targets
 bool morphNormals; // set to use morph normals

 int vertexColors;
 bool fog;

 Map<String, Attribute> attributes;

 Map defines = {};

 ShaderMaterial( { // ShaderMaterial
                   this.attributes,
                   this.fragmentShader: "void main() {}",
                   this.vertexShader: "void main() {}",
                   Map uniforms,

                   this.shading: SmoothShading,

                   this.vertexColors: NoColors,

                   this.fog: true,

                   this.wireframe: false,
                   this.wireframeLinewidth: 1,

                   this.skinning: false,
                   this.morphTargets: false,
                   this.morphNormals: false,

                   // Material
                   name: '',
                   side: FrontSide,

                   opacity: 1,
                   transparent: false,

                   blending: NormalBlending,
                   blendSrc: SrcAlphaFactor,
                   blendDst: OneMinusSrcAlphaFactor,
                   blendEquation: AddEquation,

                   depthTest: true,
                   depthWrite: true,

                   polygonOffset: false,
                   polygonOffsetFactor: 0,
                   polygonOffsetUnits:  0,

                   alphaTest: 0,

                   overdraw: false,

                   visible: true,
                   this.lights: false})
                   : super(  name: name,
                             side: side,
                             opacity: opacity,
                             transparent: transparent,
                             blending: blending,
                             blendSrc: blendSrc,
                             blendDst: blendDst,
                             blendEquation: blendEquation,
                             depthTest: depthTest,
                             depthWrite: depthWrite,
                             polygonOffset: polygonOffset,
                             polygonOffsetFactor: polygonOffsetFactor,
                             polygonOffsetUnits: polygonOffsetUnits,
                             alphaTest: alphaTest,
                             overdraw: overdraw,
                             visible: visible ) {
                     this.uniforms = (uniforms != null) ? uniforms : {};
                   }

}

Extends

Material > ShaderMaterial

Constructors

new ShaderMaterial({Map<String, Attribute> attributes, String fragmentShader: "void main() {}", String vertexShader: "void main() {}", Map uniforms, int shading: SmoothShading, int vertexColors: NoColors, bool fog: true, bool wireframe: false, num wireframeLinewidth: 1, bool skinning: false, bool morphTargets: false, bool morphNormals: false, name: '', side: FrontSide, opacity: 1, transparent: false, blending: NormalBlending, blendSrc: SrcAlphaFactor, blendDst: OneMinusSrcAlphaFactor, blendEquation: AddEquation, depthTest: true, depthWrite: true, polygonOffset: false, polygonOffsetFactor: 0, polygonOffsetUnits: 0, alphaTest: 0, overdraw: false, visible: true, bool lights: false}) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
ShaderMaterial( { // ShaderMaterial
                 this.attributes,
                 this.fragmentShader: "void main() {}",
                 this.vertexShader: "void main() {}",
                 Map uniforms,

                 this.shading: SmoothShading,

                 this.vertexColors: NoColors,

                 this.fog: true,

                 this.wireframe: false,
                 this.wireframeLinewidth: 1,

                 this.skinning: false,
                 this.morphTargets: false,
                 this.morphNormals: false,

                 // Material
                 name: '',
                 side: FrontSide,

                 opacity: 1,
                 transparent: false,

                 blending: NormalBlending,
                 blendSrc: SrcAlphaFactor,
                 blendDst: OneMinusSrcAlphaFactor,
                 blendEquation: AddEquation,

                 depthTest: true,
                 depthWrite: true,

                 polygonOffset: false,
                 polygonOffsetFactor: 0,
                 polygonOffsetUnits:  0,

                 alphaTest: 0,

                 overdraw: false,

                 visible: true,
                 this.lights: false})
                 : super(  name: name,
                           side: side,
                           opacity: opacity,
                           transparent: transparent,
                           blending: blending,
                           blendSrc: blendSrc,
                           blendDst: blendDst,
                           blendEquation: blendEquation,
                           depthTest: depthTest,
                           depthWrite: depthWrite,
                           polygonOffset: polygonOffset,
                           polygonOffsetFactor: polygonOffsetFactor,
                           polygonOffsetUnits: polygonOffsetUnits,
                           alphaTest: alphaTest,
                           overdraw: overdraw,
                           visible: visible ) {
                   this.uniforms = (uniforms != null) ? uniforms : {};
                 }

Properties

num alphaTest #

inherited from Material
num alphaTest

Map<String, Attribute> attributes #

Map<String, Attribute> attributes

int blendDst #

inherited from Material
int blending, blendSrc, blendDst

int blendEquation #

inherited from Material
int blending, blendSrc, blendDst, blendEquation

int blending #

inherited from Material
int blending

int blendSrc #

inherited from Material
int blending, blendSrc

Map defines #

Map defines = {}

bool depthTest #

inherited from Material
bool transparent, depthTest

bool depthWrite #

inherited from Material
bool transparent, depthTest, depthWrite

bool fog #

bool fog

String fragmentShader #

String fragmentShader

int id #

inherited from Material
int id

bool lights #

bool lights

bool morphNormals #

bool morphNormals

bool morphTargets #

bool morphTargets

String name #

inherited from Material
String name

bool needsUpdate #

inherited from Material
bool needsUpdate

num opacity #

inherited from Material
num opacity

bool overdraw #

inherited from Material
bool transparent, depthTest, depthWrite, overdraw

bool polygonOffset #

inherited from Material
bool polygonOffset

int polygonOffsetFactor #

inherited from Material
int polygonOffsetFactor

int polygonOffsetUnits #

inherited from Material
int polygonOffsetFactor, polygonOffsetUnits

int shading #

int shading

int side #

inherited from Material
int side

bool skinning #

bool skinning

bool transparent #

inherited from Material
bool transparent

Map<String, Uniform> uniforms #

Map<String, Uniform> uniforms

int vertexColors #

int vertexColors

String vertexShader #

String vertexShader

bool visible #

inherited from Material
bool visible

bool wireframe #

bool wireframe

num wireframeLinewidth #

num wireframeLinewidth

Operators

dynamic operator [](String key) #

inherited from Material
operator [] (String key) => _data[key];

dynamic operator []=(String key, value) #

inherited from Material
operator []= (String key, value) => _data[key] = value;