Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Damaged Helmet" model. #35

Merged
merged 1 commit into from
Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ function init(vertSource, fragSource) {
glState.uniforms['u_scaleIBLAmbient'] = { 'funcName': 'uniform4f', vals: [1.0, 1.0, 1.0, 1.0] };

// Load scene
updateModel("BoomBox", gl, glState, viewMatrix, projectionMatrix, canvas, ctx2d);
var defaultModelName = 'DamagedHelmet';
updateModel(defaultModelName, gl, glState, viewMatrix, projectionMatrix, canvas, ctx2d);

// Set clear color
gl.clearColor(0.2, 0.2, 0.2, 1.0);
Expand Down Expand Up @@ -228,8 +229,8 @@ function init(vertSource, fragSource) {
var folder = gui.addFolder("Metallic-Roughness Material");


var text = { Model: "BoomBox" };
folder.add(text, 'Model', ['MetalRoughSpheres', 'AppleTree', 'Avocado', 'BarramundiFish', 'BoomBox', 'Corset', 'FarmLandDiorama', 'NormalTangentTest', 'Telephone', 'TextureSettingsTest', 'Triangle', 'WaterBottle']).onChange(function(value) {
var text = { Model: defaultModelName };
folder.add(text, 'Model', ['MetalRoughSpheres', 'AppleTree', 'Avocado', 'BarramundiFish', 'BoomBox', 'Corset', 'DamagedHelmet', 'FarmLandDiorama', 'NormalTangentTest', 'Telephone', 'TextureSettingsTest', 'Triangle', 'WaterBottle']).onChange(function(value) {
updateModel(value, gl, glState, viewMatrix, projectionMatrix, canvas, ctx2d);
});
folder.open();
Expand Down
4 changes: 4 additions & 0 deletions models/DamagedHelmet/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Battle Damaged Sci-fi Helmet - PBR by [theblueturtle_](https://sketchfab.com/theblueturtle_), published under
a Creative Commons Attribution-NonCommercial license

https://sketchfab.com/models/b81008d513954189a063ff901f7abfe4
Binary file added models/DamagedHelmet/glTF/DamagedHelmet.bin
Binary file not shown.
204 changes: 204 additions & 0 deletions models/DamagedHelmet/glTF/DamagedHelmet.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5123,
"count" : 46356,
"max" : [
13599
],
"min" : [
0
],
"type" : "SCALAR"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 13600,
"max" : [
0.9449769854545593,
1.0,
0.9009739756584167
],
"min" : [
-0.9449769854545593,
-1.0,
-0.9009950160980225
],
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 13600,
"max" : [
1.0,
1.0,
1.0
],
"min" : [
-1.0,
-1.0,
-1.0
],
"type" : "VEC3"
},
{
"bufferView" : 3,
"componentType" : 5126,
"count" : 13600,
"max" : [
0.9999759793281555,
1.998665988445282
],
"min" : [
0.002448640065267682,
1.0005531199858524
],
"type" : "VEC2"
}
],
"asset" : {
"generator" : "Khronos Blender glTF 2.0 exporter",
"version" : "2.0"
},
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 92712,
"byteOffset" : 0,
"target" : 34963
},
{
"buffer" : 0,
"byteLength" : 163200,
"byteOffset" : 92712,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 163200,
"byteOffset" : 255912,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 108800,
"byteOffset" : 419112,
"target" : 34962
}
],
"buffers" : [
{
"byteLength" : 527912,
"uri" : "DamagedHelmet.bin"
}
],
"images" : [
{
"uri" : "Default_albedo.jpg"
},
{
"uri" : "Default_normal.jpg"
},
{
"uri" : "Default_metalRoughness.jpg"
},
{
"uri" : "Default_emissive.jpg"
},
{
"uri" : "Default_AO.jpg"
}
],
"materials" : [
{
"emissiveFactor" : [
1.0,
1.0,
1.0
],
"emissiveTexture" : {
"index" : 3
},
"name" : "glTF Material",
"normalTexture" : {
"index" : 1
},
"occlusionTexture" : {
"index" : 4
},
"pbrMetallicRoughness" : {
"baseColorTexture" : {
"index" : 0
},
"metallicRoughnessTexture" : {
"index" : 2
}
}
}
],
"meshes" : [
{
"name" : "mesh_helmet_LP_13930damagedHelmet",
"primitives" : [
{
"attributes" : {
"NORMAL" : 2,
"POSITION" : 1,
"TEXCOORD_0" : 3
},
"indices" : 0,
"material" : 0
}
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "node_damagedHelmet_-6514",
"rotation" : [
0.7071068286895752,
0.0,
-0.0,
0.7071068286895752
]
}
],
"samplers" : [
{}
],
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0
]
}
],
"textures" : [
{
"sampler" : 0,
"source" : 0
},
{
"sampler" : 0,
"source" : 1
},
{
"sampler" : 0,
"source" : 2
},
{
"sampler" : 0,
"source" : 3
},
{
"sampler" : 0,
"source" : 4
}
]
}
Binary file added models/DamagedHelmet/glTF/Default_AO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/DamagedHelmet/glTF/Default_albedo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/DamagedHelmet/glTF/Default_emissive.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/DamagedHelmet/glTF/Default_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.