aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/Materials/QuiltMaterial.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/Materials/QuiltMaterial.js')
-rw-r--r--js/helper-classes/RDGE/Materials/QuiltMaterial.js168
1 files changed, 0 insertions, 168 deletions
diff --git a/js/helper-classes/RDGE/Materials/QuiltMaterial.js b/js/helper-classes/RDGE/Materials/QuiltMaterial.js
deleted file mode 100644
index ba192d53..00000000
--- a/js/helper-classes/RDGE/Materials/QuiltMaterial.js
+++ /dev/null
@@ -1,168 +0,0 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7 ///////////////////////////////////////////////////////////////////////
8// Class GLMaterial
9// GL representation of a material.
10///////////////////////////////////////////////////////////////////////
11function QuiltMaterial01()
12{
13 // initialize the inherited members
14 this.inheritedFrom = GLMaterial;
15 this.inheritedFrom();
16
17 ///////////////////////////////////////////////////////////////////////
18 // Instance variables
19 ///////////////////////////////////////////////////////////////////////
20 this._name = "QuiltMaterial 1";
21 this._shaderName = "quilt_1";
22
23 ///////////////////////////////////////////////////////////////////////
24 // Property Accessors
25 ///////////////////////////////////////////////////////////////////////
26 this.getShaderName = function() { return this._shaderName; }
27
28 ///////////////////////////////////////////////////////////////////////
29 // Methods
30 ///////////////////////////////////////////////////////////////////////
31 this.dup = function() { return new QuiltMaterial01(); }
32
33 this.init = function()
34 {
35
36 // set up the material node
37 this._materialNode = createMaterialNode("quiltMaterial01")
38 this._materialNode.setDiffuseTexture("quilt01");
39 this._materialNode.setSpecTexture("quilt01_E");
40 this._materialNode.setNormalTexture("quilt01_N");
41
42 // set up the shader
43 this._shader = new jshader();
44 this._shader.def = quiltShaderDef;
45 this._shader.init();
46 this._materialNode.setShader(this._shader);
47 }
48}
49
50///////////////////////////////////////////////////////////////////////
51// Class GLMaterial
52// GL representation of a material.
53///////////////////////////////////////////////////////////////////////
54function QuiltMaterial02()
55{
56 // initialize the inherited members
57 this.inheritedFrom = GLMaterial;
58 this.inheritedFrom();
59
60 ///////////////////////////////////////////////////////////////////////
61 // Instance variables
62 ///////////////////////////////////////////////////////////////////////
63 this._name = "QuiltMaterial 2";
64 this._shaderName = "quilt_2";
65
66 ///////////////////////////////////////////////////////////////////////
67 // Property Accessors
68 ///////////////////////////////////////////////////////////////////////
69 this.getShaderName = function() { return this._shaderName; }
70
71 ///////////////////////////////////////////////////////////////////////
72 // Methods
73 ///////////////////////////////////////////////////////////////////////
74 this.dup = function() { return new QuiltMaterial02(); }
75
76 this.init = function()
77 {
78
79 // set up the material node
80 this._materialNode = createMaterialNode("quiltMaterial02")
81 this._materialNode.setDiffuseTexture("quilt02");
82 this._materialNode.setSpecTexture("quilt02_E");
83 this._materialNode.setNormalTexture("quilt02_N");
84
85 // set up the shader
86 this._shader = new jshader();
87 this._shader.def = quilt2ShaderDef;
88 this._shader.init();
89 this._materialNode.setShader(this._shader);
90 }
91}
92
93///////////////////////////////////////////////////////////////////////////////////////
94// RDGE shaders
95/*
96 * The main shader for the scene
97 */
98var quiltShaderDef = {'shaders': {
99 // this shader is being referenced by file
100 'defaultVShader':"assets/shaders/quilt_vshader.glsl",
101 'defaultFShader':"assets/shaders/quilt_fshader.glsl",
102
103 },
104 'techniques': {
105 'default':[{
106 'vshader' : 'defaultVShader',
107 'fshader' : 'defaultFShader',
108 // attributes
109 'attributes' :
110 {
111 'vert' : { 'type' : 'vec3' },
112 'normal' : { 'type' : 'vec3' },
113 'texcoord' : { 'type' : 'vec2' },
114 },
115 // parameters
116 'params' :
117 {
118 //'u_light0Diff' : { 'type' : 'vec4' },
119 //'u_matDiffuse' : { 'type' : 'vec4' }
120 },
121
122 // render states
123 'states' :
124 {
125 'depthEnable' : true,
126 'offset':[1.0, 0.1],
127 'blendEnabled' : true,
128 'srcBlend' : 'SRC_ALPHA',
129 'dstcBlend' : 'ONE_MINUS_SRC_ALPHA'
130 },
131 }]
132 }};
133
134var quilt2ShaderDef = {'shaders': {
135 // this shader is being referenced by file
136 'defaultVShader':"assets/shaders/quilt_vshader.glsl",
137 'defaultFShader':"assets/shaders/quilt2_fshader.glsl",
138
139 },
140 'techniques': {
141 'default':[{
142 'vshader' : 'defaultVShader',
143 'fshader' : 'defaultFShader',
144 // attributes
145 'attributes' :
146 {
147 'vert' : { 'type' : 'vec3' },
148 'normal' : { 'type' : 'vec3' },
149 'texcoord' : { 'type' : 'vec2' },
150 },
151 // parameters
152 'params' :
153 {
154 //'u_light0Diff' : { 'type' : 'vec4' },
155 //'u_matDiffuse' : { 'type' : 'vec4' }
156 },
157
158 // render states
159 'states' :
160 {
161 'depthEnable' : true,
162 'offset':[1.0, 0.1],
163 'blendEnabled' : true,
164 'srcBlend' : 'SRC_ALPHA',
165 'dstcBlend' : 'ONE_MINUS_SRC_ALPHA'
166 },
167 }]
168 }};