Skip to content

Commit

Permalink
[gltf-loader] - Removed web-obj-loader and replaced with gltf loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Trung Le committed Feb 21, 2016
1 parent cd63174 commit 9575415
Show file tree
Hide file tree
Showing 13 changed files with 388 additions and 40,140 deletions.
12 changes: 0 additions & 12 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,6 @@ 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.

## webgl-obj-loader

https://github.com/frenchtoast747/webgl-obj-loader

> Copyright (c) 2013 Aaron Boman and aaronboman.com
>
> 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:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> 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.
## OpenGL ES 3.0: Programming Guide

https://github.com/danginsburg/opengles3-book
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ When you open a pull request, please make sure that GitHub reports that "All che
* [OpenGL Samples Pack](https://github.com/g-truc/ogl-samples) by Christophe Riccio ([@Groovounet](https://github.com/Groovounet)) and contributors
* [Cesium](https://github.com/AnalyticalGraphicsInc/cesium) build script by Matt Amato ([@mramato](https://github.com/mramato)) and contributors
* [webgl2-particles](https://github.com/toji/webgl2-particles) by Brandon Jones ([@toji](https://github.com/toji)) and Mr.doob ([@mrdoob](https://github.com/mrdoob))
* [webgl-obj-loader.js](https://github.com/frenchtoast747/webgl-obj-loader) by Aaron Boman ([@frenchtoast747](https://github.com/frenchtoast747)) and contributors
Binary file added assets/gltf/plane.bin
Binary file not shown.
267 changes: 267 additions & 0 deletions assets/gltf/plane.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
{
"accessors": {
"accessor_index_0": {
"bufferView": "bufferView_index",
"byteOffset": 0,
"byteStride": 0,
"componentType": 5123,
"count": 5400,
"type": "SCALAR"
},
"accessor_position": {
"bufferView": "bufferView_vertex",
"byteOffset": 0,
"byteStride": 32,
"componentType": 5126,
"count": 961,
"min": [
-0.5,
0,
-0.5
],
"max": [
0.5,
5e-324,
0.5
],
"type": "VEC3"
},
"accessor_normal": {
"bufferView": "bufferView_vertex",
"byteOffset": 12,
"byteStride": 32,
"componentType": 5126,
"count": 961,
"type": "VEC3"
},
"accessor_uv": {
"bufferView": "bufferView_vertex",
"byteOffset": 24,
"byteStride": 32,
"componentType": 5126,
"count": 961,
"type": "VEC2"
}
},
"asset": {
"generator": "OBJ2GLTF",
"premultipliedAlpha": true,
"profile": {
"api": "WebGL",
"version": "1.0"
},
"version": 1
},
"buffers": {
"buffer_plane": {
"byteLength": 41552,
"type": "arraybuffer",
"uri": "plane.bin"
}
},
"bufferViews": {
"bufferView_vertex": {
"buffer": "buffer_plane",
"byteLength": 30752,
"byteOffset": 0,
"target": 34962
},
"bufferView_index": {
"buffer": "buffer_plane",
"byteLength": 10800,
"byteOffset": 30752,
"target": 34963
}
},
"extensionsUsed": [],
"images": {},
"materials": {
"material_czmDefaultMat": {
"name": "czmDefaultMat",
"extensions": {},
"values": {
"ambient": [
0,
0,
0,
1
],
"diffuse": [
0.5,
0.5,
0.5,
1
],
"emission": [
0,
0,
0,
1
],
"specular": [
0,
0,
0,
1
],
"shininess": 0,
"transparency": 1
},
"technique": "technique0"
}
},
"meshes": {
"mesh_plane": {
"name": "plane",
"primitives": [
{
"attributes": {
"POSITION": "accessor_position",
"NORMAL": "accessor_normal",
"TEXCOORD_0": "accessor_uv"
},
"indices": "accessor_index_0",
"material": "material_czmDefaultMat",
"mode": 4
}
]
}
},
"nodes": {
"node_plane": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"mesh_plane"
],
"name": "plane"
}
},
"samplers": {
"sampler_0": {}
},
"scene": "scene_plane",
"scenes": {
"scene_plane": {
"nodes": [
"node_plane"
]
}
},
"textures": {},
"programs": {
"program0": {
"attributes": [
"a_position",
"a_normal",
"a_texcoord_0"
],
"fragmentShader": "fragmentShader0",
"vertexShader": "vertexShader0"
}
},
"shaders": {
"vertexShader0": {
"type": 35633,
"uri": "",
"extras": {
"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"
}
},
"fragmentShader0": {
"type": 35632,
"uri": "",
"extras": {
"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"
}
}
},
"techniques": {
"technique0": {
"attributes": {
"a_position": "position",
"a_normal": "normal",
"a_texcoord_0": "texcoord_0"
},
"parameters": {
"modelViewMatrix": {
"semantic": "MODELVIEW",
"type": 35676
},
"normalMatrix": {
"semantic": "MODELVIEWINVERSETRANSPOSE",
"type": 35675
},
"projectionMatrix": {
"semantic": "PROJECTION",
"type": 35676
},
"ambient": {
"type": 35666
},
"diffuse": {
"type": 35666
},
"emission": {
"type": 35666
},
"specular": {
"type": 35666
},
"shininess": {
"type": 5126
},
"transparency": {
"type": 5126
},
"position": {
"semantic": "POSITION",
"type": 35665
},
"normal": {
"semantic": "NORMAL",
"type": 35665
},
"texcoord_0": {
"semantic": "TEXCOORD_0",
"type": 35664
}
},
"program": "program0",
"states": {
"enable": [
2884,
2929
]
},
"uniforms": {
"u_modelViewMatrix": "modelViewMatrix",
"u_normalMatrix": "normalMatrix",
"u_projectionMatrix": "projectionMatrix",
"u_ambient": "ambient",
"u_diffuse": "diffuse",
"u_emission": "emission",
"u_specular": "specular",
"u_shininess": "shininess",
"u_transparency": "transparency"
}
}
}
}
6 changes: 0 additions & 6 deletions assets/obj/cornell_box.mtl

This file was deleted.

Loading

0 comments on commit 9575415

Please sign in to comment.