diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-09-28 16:17:56 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-09-28 16:17:56 -0400 |
| commit | 43f3dc16cc9e43c459814249089c79f22eefa7dc (patch) | |
| tree | 74cf6c9d447183af89180acefcace146cea98428 | |
| parent | d8133778d078356501ea6e30ce9408edb9b0c19b (diff) | |
add torus and update models to not include vertex color
| -rw-r--r-- | assets/models/cube.bin | bin | 1224 -> 840 bytes | |||
| -rw-r--r-- | assets/models/cube.gltf | 37 | ||||
| -rw-r--r-- | assets/models/plane.gltf | 2 | ||||
| -rw-r--r-- | assets/models/torus.bin | bin | 0 -> 80640 bytes | |||
| -rw-r--r-- | assets/models/torus.gltf | 137 | ||||
| -rw-r--r-- | assets/models/torus.png | bin | 0 -> 325509 bytes | |||
| -rw-r--r-- | assets/shaders/texture.frag | 6 | ||||
| -rw-r--r-- | assets/shaders/vert.vert | 4 |
8 files changed, 158 insertions, 28 deletions
diff --git a/assets/models/cube.bin b/assets/models/cube.bin Binary files differindex 6223cf0..5494d9c 100644 --- a/assets/models/cube.bin +++ b/assets/models/cube.bin diff --git a/assets/models/cube.gltf b/assets/models/cube.gltf index 9bc8a22..e43dd04 100644 --- a/assets/models/cube.gltf +++ b/assets/models/cube.gltf @@ -37,12 +37,11 @@ "primitives":[ { "attributes":{ - "COLOR_0":0, - "POSITION":1, - "NORMAL":2, - "TEXCOORD_0":3 + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 }, - "indices":4, + "indices":3, "material":0 } ] @@ -66,12 +65,6 @@ "bufferView":0, "componentType":5126, "count":24, - "type":"VEC4" - }, - { - "bufferView":1, - "componentType":5126, - "count":24, "max":[ 1, 1, @@ -85,19 +78,19 @@ "type":"VEC3" }, { - "bufferView":2, + "bufferView":1, "componentType":5126, "count":24, "type":"VEC3" }, { - "bufferView":3, + "bufferView":2, "componentType":5126, "count":24, "type":"VEC2" }, { - "bufferView":4, + "bufferView":3, "componentType":5123, "count":36, "type":"SCALAR" @@ -106,32 +99,26 @@ "bufferViews":[ { "buffer":0, - "byteLength":384, - "byteOffset":0, - "target":34962 - }, - { - "buffer":0, "byteLength":288, - "byteOffset":384, + "byteOffset":0, "target":34962 }, { "buffer":0, "byteLength":288, - "byteOffset":672, + "byteOffset":288, "target":34962 }, { "buffer":0, "byteLength":192, - "byteOffset":960, + "byteOffset":576, "target":34962 }, { "buffer":0, "byteLength":72, - "byteOffset":1152, + "byteOffset":768, "target":34963 } ], @@ -143,7 +130,7 @@ ], "buffers":[ { - "byteLength":1224, + "byteLength":840, "uri":"cube.bin" } ] diff --git a/assets/models/plane.gltf b/assets/models/plane.gltf index da40554..6d9c6a5 100644 --- a/assets/models/plane.gltf +++ b/assets/models/plane.gltf @@ -21,7 +21,7 @@ "materials":[ { "doubleSided":true, - "name":"Material", + "name":"Material.001", "pbrMetallicRoughness":{ "baseColorTexture":{ "index":0 diff --git a/assets/models/torus.bin b/assets/models/torus.bin Binary files differnew file mode 100644 index 0000000..4c92207 --- /dev/null +++ b/assets/models/torus.bin diff --git a/assets/models/torus.gltf b/assets/models/torus.gltf new file mode 100644 index 0000000..89f5103 --- /dev/null +++ b/assets/models/torus.gltf @@ -0,0 +1,137 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v3.6.27", + "version":"2.0" + }, + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 0 + ] + } + ], + "nodes":[ + { + "mesh":0, + "name":"Torus" + } + ], + "materials":[ + { + "doubleSided":true, + "name":"Material.001", + "pbrMetallicRoughness":{ + "baseColorTexture":{ + "index":0 + }, + "metallicFactor":0, + "roughnessFactor":0.5 + } + } + ], + "meshes":[ + { + "name":"Torus", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3, + "material":0 + } + ] + } + ], + "textures":[ + { + "sampler":0, + "source":0 + } + ], + "images":[ + { + "mimeType":"image/png", + "name":"torus", + "uri":"torus.png" + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":2304, + "max":[ + 1.25, + 1.25, + 0.25 + ], + "min":[ + -1.25, + -1.25, + -0.25 + ], + "type":"VEC3" + }, + { + "bufferView":1, + "componentType":5126, + "count":2304, + "type":"VEC3" + }, + { + "bufferView":2, + "componentType":5126, + "count":2304, + "type":"VEC2" + }, + { + "bufferView":3, + "componentType":5123, + "count":3456, + "type":"SCALAR" + } + ], + "bufferViews":[ + { + "buffer":0, + "byteLength":27648, + "byteOffset":0, + "target":34962 + }, + { + "buffer":0, + "byteLength":27648, + "byteOffset":27648, + "target":34962 + }, + { + "buffer":0, + "byteLength":18432, + "byteOffset":55296, + "target":34962 + }, + { + "buffer":0, + "byteLength":6912, + "byteOffset":73728, + "target":34963 + } + ], + "samplers":[ + { + "magFilter":9729, + "minFilter":9987 + } + ], + "buffers":[ + { + "byteLength":80640, + "uri":"torus.bin" + } + ] +} diff --git a/assets/models/torus.png b/assets/models/torus.png Binary files differnew file mode 100644 index 0000000..dc3f10f --- /dev/null +++ b/assets/models/torus.png diff --git a/assets/shaders/texture.frag b/assets/shaders/texture.frag index 44e3dd6..9859bb6 100644 --- a/assets/shaders/texture.frag +++ b/assets/shaders/texture.frag @@ -9,8 +9,12 @@ layout(binding = 1) uniform sampler2D texSampler; void main() { vec4 color = texture(texSampler, fragTexCoord.xy); +/* if (color.w == 0) { discard; } - outColor = color; +*/ + outColor = color; + // outColor = vec4(0.0, 0.8, 0.0, 1.0); + // outColor = vec4(fragTexCoord.xyz, 1.0); } diff --git a/assets/shaders/vert.vert b/assets/shaders/vert.vert index 07044c8..593e88c 100644 --- a/assets/shaders/vert.vert +++ b/assets/shaders/vert.vert @@ -27,10 +27,12 @@ void main() { ubo.proj * ubo.view * ubo.model * + vec4(inPosition, 1.0); +/* vec4(instPos, 1.0) * vec4(instRot, 1.0) * vec4(instScale, 1.0) * - vec4(inPosition, 1.0); +*/ fragColor = vec4(0.0, 0.0, 0.0, 0.0); fragTexCoord = vec3(inUV, 0); } |
