aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/flat-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/flat-material.js')
-rwxr-xr-xjs/lib/rdge/materials/flat-material.js60
1 files changed, 30 insertions, 30 deletions
diff --git a/js/lib/rdge/materials/flat-material.js b/js/lib/rdge/materials/flat-material.js
index 6b8bd2c5..5fa46231 100755
--- a/js/lib/rdge/materials/flat-material.js
+++ b/js/lib/rdge/materials/flat-material.js
@@ -48,8 +48,8 @@ var FlatMaterial = function FlatMaterial()
48 // Property Accessors 48 // Property Accessors
49 /////////////////////////////////////////////////////////////////////// 49 ///////////////////////////////////////////////////////////////////////
50 this.getShaderName = function () { return this._shaderName; }; 50 this.getShaderName = function () { return this._shaderName; };
51 this.isAnimated = function () { return false; }; 51 this.isAnimated = function () { return false; };
52 this.getTechniqueName = function() { return 'colorMe' }; 52 this.getTechniqueName = function() { return 'colorMe' };
53 53
54 /////////////////////////////////////////////////////////////////////// 54 ///////////////////////////////////////////////////////////////////////
55 // Methods 55 // Methods
@@ -57,7 +57,7 @@ var FlatMaterial = function FlatMaterial()
57 // duplcate method requirde 57 // duplcate method requirde
58 58
59 this.init = function (world) 59 this.init = function (world)
60 { 60 {
61 // save the world 61 // save the world
62 if (world) { 62 if (world) {
63 this.setWorld(world); 63 this.setWorld(world);
@@ -70,8 +70,8 @@ var FlatMaterial = function FlatMaterial()
70 // set up the material node 70 // set up the material node
71 this._materialNode = RDGE.createMaterialNode("flatMaterial_" + world.generateUniqueNodeID()); 71 this._materialNode = RDGE.createMaterialNode("flatMaterial_" + world.generateUniqueNodeID());
72 this._materialNode.setShader(this._shader); 72 this._materialNode.setShader(this._shader);
73 73
74 this.setShaderValues(); 74 this.setShaderValues();
75 } 75 }
76 else 76 else
77 throw new Error("GLWorld not supplied to material initialization"); 77 throw new Error("GLWorld not supplied to material initialization");
@@ -95,31 +95,31 @@ var FlatMaterial = function FlatMaterial()
95// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 95// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
96flatShaderDef = 96flatShaderDef =
97{ 97{
98 'shaders': { // shader files 98 'shaders': { // shader files
99 'defaultVShader':"assets/shaders/Basic.vert.glsl", 99 'defaultVShader':"assets/shaders/Basic.vert.glsl",
100 'defaultFShader':"assets/shaders/Basic.frag.glsl" 100 'defaultFShader':"assets/shaders/Basic.frag.glsl"
101 }, 101 },
102 'techniques': { // rendering control 102 'techniques': { // rendering control
103 'colorMe':[ // simple color pass 103 'colorMe':[ // simple color pass
104 { 104 {
105 'vshader' : 'defaultVShader', 105 'vshader' : 'defaultVShader',
106 'fshader' : 'defaultFShader', 106 'fshader' : 'defaultFShader',
107 107
108 // attributes 108 // attributes
109 'attributes' : 109 'attributes' :
110 { 110 {
111 'vert' : { 'type' : 'vec3' }, 111 'vert' : { 'type' : 'vec3' },
112 'normal' : { 'type' : 'vec3' }, 112 'normal' : { 'type' : 'vec3' },
113 'texcoord' : { 'type' : 'vec2' } 113 'texcoord' : { 'type' : 'vec2' }
114 }, 114 },
115 // attributes 115 // attributes
116 'params' : 116 'params' :
117 { 117 {
118 'color' : { 'type' : 'vec4' } 118 'color' : { 'type' : 'vec4' }
119 } 119 }
120 } 120 }
121 ] 121 ]
122 } 122 }
123}; 123};
124 124
125FlatMaterial.prototype = new Material(); 125FlatMaterial.prototype = new Material();