Skip to content

Commit 9575415

Browse files
author
Trung Le
committed
[gltf-loader] - Removed web-obj-loader and replaced with gltf loader
1 parent cd63174 commit 9575415

13 files changed

+388
-40140
lines changed

Diff for: LICENSE.md

-12
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134134
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
135135
THE SOFTWARE.
136136

137-
## webgl-obj-loader
138-
139-
https://github.com/frenchtoast747/webgl-obj-loader
140-
141-
> Copyright (c) 2013 Aaron Boman and aaronboman.com
142-
>
143-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
144-
>
145-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
146-
>
147-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
148-
149137
## OpenGL ES 3.0: Programming Guide
150138

151139
https://github.com/danginsburg/opengles3-book

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,3 @@ When you open a pull request, please make sure that GitHub reports that "All che
101101
* [OpenGL Samples Pack](https://github.com/g-truc/ogl-samples) by Christophe Riccio ([@Groovounet](https://github.com/Groovounet)) and contributors
102102
* [Cesium](https://github.com/AnalyticalGraphicsInc/cesium) build script by Matt Amato ([@mramato](https://github.com/mramato)) and contributors
103103
* [webgl2-particles](https://github.com/toji/webgl2-particles) by Brandon Jones ([@toji](https://github.com/toji)) and Mr.doob ([@mrdoob](https://github.com/mrdoob))
104-
* [webgl-obj-loader.js](https://github.com/frenchtoast747/webgl-obj-loader) by Aaron Boman ([@frenchtoast747](https://github.com/frenchtoast747)) and contributors

Diff for: assets/gltf/plane.bin

40.6 KB
Binary file not shown.

Diff for: assets/gltf/plane.gltf

+267
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
{
2+
"accessors": {
3+
"accessor_index_0": {
4+
"bufferView": "bufferView_index",
5+
"byteOffset": 0,
6+
"byteStride": 0,
7+
"componentType": 5123,
8+
"count": 5400,
9+
"type": "SCALAR"
10+
},
11+
"accessor_position": {
12+
"bufferView": "bufferView_vertex",
13+
"byteOffset": 0,
14+
"byteStride": 32,
15+
"componentType": 5126,
16+
"count": 961,
17+
"min": [
18+
-0.5,
19+
0,
20+
-0.5
21+
],
22+
"max": [
23+
0.5,
24+
5e-324,
25+
0.5
26+
],
27+
"type": "VEC3"
28+
},
29+
"accessor_normal": {
30+
"bufferView": "bufferView_vertex",
31+
"byteOffset": 12,
32+
"byteStride": 32,
33+
"componentType": 5126,
34+
"count": 961,
35+
"type": "VEC3"
36+
},
37+
"accessor_uv": {
38+
"bufferView": "bufferView_vertex",
39+
"byteOffset": 24,
40+
"byteStride": 32,
41+
"componentType": 5126,
42+
"count": 961,
43+
"type": "VEC2"
44+
}
45+
},
46+
"asset": {
47+
"generator": "OBJ2GLTF",
48+
"premultipliedAlpha": true,
49+
"profile": {
50+
"api": "WebGL",
51+
"version": "1.0"
52+
},
53+
"version": 1
54+
},
55+
"buffers": {
56+
"buffer_plane": {
57+
"byteLength": 41552,
58+
"type": "arraybuffer",
59+
"uri": "plane.bin"
60+
}
61+
},
62+
"bufferViews": {
63+
"bufferView_vertex": {
64+
"buffer": "buffer_plane",
65+
"byteLength": 30752,
66+
"byteOffset": 0,
67+
"target": 34962
68+
},
69+
"bufferView_index": {
70+
"buffer": "buffer_plane",
71+
"byteLength": 10800,
72+
"byteOffset": 30752,
73+
"target": 34963
74+
}
75+
},
76+
"extensionsUsed": [],
77+
"images": {},
78+
"materials": {
79+
"material_czmDefaultMat": {
80+
"name": "czmDefaultMat",
81+
"extensions": {},
82+
"values": {
83+
"ambient": [
84+
0,
85+
0,
86+
0,
87+
1
88+
],
89+
"diffuse": [
90+
0.5,
91+
0.5,
92+
0.5,
93+
1
94+
],
95+
"emission": [
96+
0,
97+
0,
98+
0,
99+
1
100+
],
101+
"specular": [
102+
0,
103+
0,
104+
0,
105+
1
106+
],
107+
"shininess": 0,
108+
"transparency": 1
109+
},
110+
"technique": "technique0"
111+
}
112+
},
113+
"meshes": {
114+
"mesh_plane": {
115+
"name": "plane",
116+
"primitives": [
117+
{
118+
"attributes": {
119+
"POSITION": "accessor_position",
120+
"NORMAL": "accessor_normal",
121+
"TEXCOORD_0": "accessor_uv"
122+
},
123+
"indices": "accessor_index_0",
124+
"material": "material_czmDefaultMat",
125+
"mode": 4
126+
}
127+
]
128+
}
129+
},
130+
"nodes": {
131+
"node_plane": {
132+
"children": [],
133+
"matrix": [
134+
1,
135+
0,
136+
0,
137+
0,
138+
0,
139+
1,
140+
0,
141+
0,
142+
0,
143+
0,
144+
1,
145+
0,
146+
0,
147+
0,
148+
0,
149+
1
150+
],
151+
"meshes": [
152+
"mesh_plane"
153+
],
154+
"name": "plane"
155+
}
156+
},
157+
"samplers": {
158+
"sampler_0": {}
159+
},
160+
"scene": "scene_plane",
161+
"scenes": {
162+
"scene_plane": {
163+
"nodes": [
164+
"node_plane"
165+
]
166+
}
167+
},
168+
"textures": {},
169+
"programs": {
170+
"program0": {
171+
"attributes": [
172+
"a_position",
173+
"a_normal",
174+
"a_texcoord_0"
175+
],
176+
"fragmentShader": "fragmentShader0",
177+
"vertexShader": "vertexShader0"
178+
}
179+
},
180+
"shaders": {
181+
"vertexShader0": {
182+
"type": 35633,
183+
"uri": "",
184+
"extras": {
185+
"source": "precision highp float;\nuniform mat4 u_modelViewMatrix;\nuniform mat3 u_normalMatrix;\nuniform mat4 u_projectionMatrix;\nattribute vec3 a_position;\nvarying vec3 v_positionEC;\nattribute vec3 a_normal;\nvarying vec3 v_normal;\nattribute vec2 a_texcoord_0;\nvarying vec2 v_texcoord_0;\nvoid main(void) {\n vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n v_positionEC = pos.xyz;\n gl_Position = u_projectionMatrix * pos;\n v_normal = u_normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n}\n"
186+
}
187+
},
188+
"fragmentShader0": {
189+
"type": 35632,
190+
"uri": "",
191+
"extras": {
192+
"source": "precision highp float;\nuniform vec4 u_ambient;\nuniform vec4 u_diffuse;\nuniform vec4 u_emission;\nuniform vec4 u_specular;\nuniform float u_shininess;\nuniform float u_transparency;\nvarying vec3 v_positionEC;\nvarying vec3 v_normal;\nvarying vec2 v_texcoord_0;\nvoid main(void) {\n vec3 normal = normalize(v_normal);\n vec4 diffuse = u_diffuse;\n vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n vec3 emission = u_emission.rgb;\n vec3 ambient = u_ambient.rgb;\n vec3 viewDir = -normalize(v_positionEC);\n vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n ambientLight += vec3(0.1, 0.1, 0.1);\n vec3 l = normalize(czm_sunDirectionEC);\n diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n vec3 color = vec3(0.0, 0.0, 0.0);\n color += diffuse.rgb * diffuseLight;\n color += emission;\n color += ambient * ambientLight;\n gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n}\n"
193+
}
194+
}
195+
},
196+
"techniques": {
197+
"technique0": {
198+
"attributes": {
199+
"a_position": "position",
200+
"a_normal": "normal",
201+
"a_texcoord_0": "texcoord_0"
202+
},
203+
"parameters": {
204+
"modelViewMatrix": {
205+
"semantic": "MODELVIEW",
206+
"type": 35676
207+
},
208+
"normalMatrix": {
209+
"semantic": "MODELVIEWINVERSETRANSPOSE",
210+
"type": 35675
211+
},
212+
"projectionMatrix": {
213+
"semantic": "PROJECTION",
214+
"type": 35676
215+
},
216+
"ambient": {
217+
"type": 35666
218+
},
219+
"diffuse": {
220+
"type": 35666
221+
},
222+
"emission": {
223+
"type": 35666
224+
},
225+
"specular": {
226+
"type": 35666
227+
},
228+
"shininess": {
229+
"type": 5126
230+
},
231+
"transparency": {
232+
"type": 5126
233+
},
234+
"position": {
235+
"semantic": "POSITION",
236+
"type": 35665
237+
},
238+
"normal": {
239+
"semantic": "NORMAL",
240+
"type": 35665
241+
},
242+
"texcoord_0": {
243+
"semantic": "TEXCOORD_0",
244+
"type": 35664
245+
}
246+
},
247+
"program": "program0",
248+
"states": {
249+
"enable": [
250+
2884,
251+
2929
252+
]
253+
},
254+
"uniforms": {
255+
"u_modelViewMatrix": "modelViewMatrix",
256+
"u_normalMatrix": "normalMatrix",
257+
"u_projectionMatrix": "projectionMatrix",
258+
"u_ambient": "ambient",
259+
"u_diffuse": "diffuse",
260+
"u_emission": "emission",
261+
"u_specular": "specular",
262+
"u_shininess": "shininess",
263+
"u_transparency": "transparency"
264+
}
265+
}
266+
}
267+
}

Diff for: assets/obj/cornell_box.mtl

-6
This file was deleted.

0 commit comments

Comments
 (0)