diff --git a/Models/USDShaderBallForGltf/README.body.md b/Models/USDShaderBallForGltf/README.body.md new file mode 100644 index 00000000..a57f45f8 --- /dev/null +++ b/Models/USDShaderBallForGltf/README.body.md @@ -0,0 +1,50 @@ +## Screenshot + +![Screenshot of the asset in the three.js editor](screenshot/screenshot_large.jpg) +
_Screenshot from [three.js editor](https://threejs.org/editor/) with the environment Studio Neutral, "Realistic" (pathtraced) versus "Solid" (rasterized)._ + +![Screenshot of three.js editor settings](screenshot/threejs-editor-lighting.jpg) +
_Environment lighting settings were adjusted in the three.js editor, to match the lighting as seen in the [glTF Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/)._ + +## Description + +This is an adaptation and conversion of the [USD Standard Shader Ball](https://github.com/usd-wg/assets/tree/main/full_assets/StandardShaderBall) asset. The readme for the original asset has a wealth of information about the decisions made for how it was constructed, well worth a read. + +## Alterations + +Various adjustments were made to the original USD asset, for optimal use with glTF real-time rendering scenarios: + - The floor, lights, and camera were removed. + - The shader ball meshes were edited to create a more even amount of subdivision. + - One of the sss_bars was adjusted to avoid interpenetration with the outer "material" surface. + - One of the bubbles was moved to avoid penetrating the inner "core" surface. + - UVs were adjusted on the outer material ball to reduce seams, by attaching an isolated UV island on the rear, and relaxing the result. + - An ambient occlusion texture was baked for the outer material ball. + - A "thickness" texture was created for use with [KHR_materials_volume](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#khr_materials_volume), by inverting the normals of the outer material ball mesh, then baking an ambient occlusion texture. This creates something similar to a thickness texture. + - UVs were created for the "core" and "base" meshes, and a shared ambient occlusion texture was baked for these two meshes. + +![Ambient occlusion textures shown on the 3d model](screenshot/screenshot_occlusion.jpg) +
_Ambient occlusion textures shown on the 3d model._ + +![Thickness texture shown on the 3d model](screenshot/screenshot_thickness.jpg) +
_Thickness texture shown on the 3d model._ + +## Alpha Sorting +The triangles for the red "material" surface were re-ordered to improve alpha sorting, by detaching and re-attaching chunks of triangles. + +This was done to force them to be drawn in the order they would most likely be drawn for alpha blending by a real-time rasterizer renderer, from far to near. + +The inside surface of the red ball was assigned the first set of triangle numbers, then the 3/4-circle base, then the bubble voids, then finally the outer surface of the red ball. + +## Materials + +The material ball features two materials, one for the outer "material" surface which is meant to be replaced with whatever material is desired, and the other for the inner surfaces which use a fully-rough and 18%-gray material. + +The outer "material" surface has been assigned a material with [KHR_materials_transmission](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md#khr_materials_transmission-) and [KHR_materials_volume](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#khr_materials_volume). The `thicknessFactor` was set to 1cm to match the thickest parts of the surface. The attenuationColor and attenuationDistance were adjusted to look similar to the USD glass renders. + +A flat normal map was added to both materials, to force the generation of tangents since they may be needed by subsequent materials. + +The occlusionTexture strength has been set to 0.5 for both materials; this can be adjusted as needed for subsequent materials. + +## Editing and Export + +The USD asset was edited using [Autodesk 3ds Max](https://www.autodesk.com/products/3ds-max/overview), exported with [Hayashi Satoshi glTF exporter](https://nu1963u.wixsite.com/custom3dsmax/gltfpluginfor3dsmax), then tangents were generated using [glTF Editor](https://www.gltfeditor.com/), and the asset was iterated until all warnings were fixed to get a clean report from the [glTF Validator](https://github.khronos.org/glTF-Validator/). \ No newline at end of file diff --git a/Models/USDShaderBallForGltf/glTF-Binary/USDShaderBallForGltf.glb b/Models/USDShaderBallForGltf/glTF-Binary/USDShaderBallForGltf.glb new file mode 100644 index 00000000..d5866377 Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF-Binary/USDShaderBallForGltf.glb differ diff --git a/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.bin b/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.bin new file mode 100644 index 00000000..c495e009 Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.bin differ diff --git a/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.gltf b/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.gltf new file mode 100644 index 00000000..c05623c9 --- /dev/null +++ b/Models/USDShaderBallForGltf/glTF/USDShaderBallForGltf.gltf @@ -0,0 +1,824 @@ +{ + "asset": { + "copyright": "CCBY 4.0, geometry and textures: Chris Rydalch; original specification and validation: André Mazzone; original scene, inspiration and consultation: Thomas Anagnostou; glTF conversion: Eric Chadwick", + "generator": "gltfeditor.com", + "version": "2.0" + }, + "buffers": [ + { + "uri": "USDShaderBallForGltf.bin", + "byteLength": 1035192 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 16440, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 16440, + "byteLength": 16440, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 32880, + "byteLength": 10960, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 43840, + "byteLength": 21920, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 65760, + "byteLength": 15552, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 81312, + "byteLength": 40116, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 121428, + "byteLength": 40116, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 161544, + "byteLength": 26744, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 188288, + "byteLength": 53488, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 241776, + "byteLength": 36864, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 278640, + "byteLength": 144828, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 423468, + "byteLength": 144828, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 568296, + "byteLength": 96552, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 664848, + "byteLength": 193104, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 857952, + "byteLength": 138552, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 996504, + "byteLength": 7920, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1004424, + "byteLength": 7920, + "byteStride": 12, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1012344, + "byteLength": 5280, + "byteStride": 8, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1017624, + "byteLength": 10560, + "byteStride": 16, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 1028184, + "byteLength": 7008, + "target": 34963 + } + ], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 1370, + "min": [ + -1, + -1, + -1 + ], + "max": [ + 1, + 1, + 0.9999999403953552 + ], + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 1370, + "min": [ + -3.1424999237060547, + 0, + -3.1424999237060547 + ], + "max": [ + 3.1424999237060547, + 1.0800001621246338, + 3.1424999237060547 + ], + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 1370, + "min": [ + 0, + 0.13088107109069824 + ], + "max": [ + 0.4788788855075836, + 0.9999997615814209 + ], + "type": "VEC2" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 1370, + "min": [ + -0.9999253153800964, + -0.9999262094497681, + -0.9947656989097595, + -1 + ], + "max": [ + 0.879151463508606, + 0.9999262094497681, + 0.705284059047699, + -1 + ], + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "normalized": false, + "count": 7776, + "min": [ + 0 + ], + "max": [ + 1369 + ], + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 3343, + "min": [ + -0.9999381899833679, + -0.999993085861206, + -0.9999380707740784 + ], + "max": [ + 0.9999500513076782, + 0.9999014139175415, + 0.9999500513076782 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 3343, + "min": [ + -2.6925480365753174, + 1.7548558712005615, + -2.692633628845215 + ], + "max": [ + 2.695894718170166, + 7.142886638641357, + 2.6958086490631104 + ], + "type": "VEC3" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 3343, + "min": [ + 0.3684975802898407, + 0.026162266731262207 + ], + "max": [ + 1, + 1 + ], + "type": "VEC2" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 3343, + "min": [ + -1, + -0.7149921655654907, + -0.999998927116394, + -1 + ], + "max": [ + 0.9999979138374329, + 0.7071139216423035, + 0.9999999403953552, + -1 + ], + "type": "VEC4" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5123, + "normalized": false, + "count": 18432, + "min": [ + 0 + ], + "max": [ + 3342 + ], + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 12069, + "min": [ + -1, + -1, + -1 + ], + "max": [ + 1, + 1, + 1 + ], + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 12069, + "min": [ + -4.462121963500977, + 0.38515323400497437, + -4.462122440338135 + ], + "max": [ + 4.461443901062012, + 8.204633712768555, + 4.4614434242248535 + ], + "type": "VEC3" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 12069, + "min": [ + 0, + 0.003414750099182129 + ], + "max": [ + 0.9996399283409119, + 1 + ], + "type": "VEC2" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 12069, + "min": [ + -1, + -0.9999897480010986, + -0.9999999403953552, + -1 + ], + "max": [ + 1, + 0.9999656677246094, + 1, + -1 + ], + "type": "VEC4" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5123, + "normalized": false, + "count": 69276, + "min": [ + 0 + ], + "max": [ + 12068 + ], + "type": "SCALAR" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 660, + "min": [ + -0.9826815724372864, + -0.9826751947402954, + -0.9826745986938477 + ], + "max": [ + 0.9824094176292419, + 0.9824073314666748, + 0.9824076294898987 + ], + "type": "VEC3" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 660, + "min": [ + -0.4878491461277008, + 5.0547027587890625, + -0.5115311145782471 + ], + "max": [ + 3.6077330112457275, + 8.05561637878418, + 3.612475872039795 + ], + "type": "VEC3" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 660, + "min": [ + -0.02289259433746338, + 0.00007510185241699219 + ], + "max": [ + 0.9992879033088684, + 0.9838582873344421 + ], + "type": "VEC2" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "normalized": false, + "count": 660, + "min": [ + -1, + -0.9338201880455017, + -1, + -1 + ], + "max": [ + 1, + 0.9468715190887451, + 1, + -1 + ], + "type": "VEC4" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5123, + "normalized": false, + "count": 3504, + "min": [ + 0 + ], + "max": [ + 659 + ], + "type": "SCALAR" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1, + 2, + 3 + ], + "name": "USDShaderBallForGltf" + } + ], + "nodes": [ + { + "name": "base", + "matrix": [ + 0.009999999776482582, + 0, + 0, + 0, + 0, + 0.009999999776482582, + 1.6292067694934076e-9, + 0, + 0, + -1.6292067694934076e-9, + 0.009999999776482582, + 0, + 0, + 0, + 0, + 1 + ], + "mesh": 0 + }, + { + "name": "core", + "matrix": [ + 0.009999999776482582, + 0, + 0, + 0, + 0, + 0.009999999776482582, + 1.6292067694934076e-9, + 0, + 0, + -1.6292067694934076e-9, + 0.009999999776482582, + 0, + 0, + 0, + 0, + 1 + ], + "mesh": 1 + }, + { + "name": "material_surface", + "matrix": [ + 0.009999999776482582, + 0, + 0, + 0, + 0, + 0.009999999776482582, + 1.6292067694934076e-9, + 0, + 0, + -1.6292067694934076e-9, + 0.009999999776482582, + 0, + 0, + 0, + 0, + 1 + ], + "mesh": 2 + }, + { + "name": "sss_bars", + "matrix": [ + 0.009999999776482582, + 0, + 0, + 0, + 0, + 0.009999999776482582, + 1.6292067694934076e-9, + 0, + 0, + -1.6292067694934076e-9, + 0.009999999776482582, + 0, + 0, + 0, + 0, + 1 + ], + "mesh": 3 + } + ], + "meshes": [ + { + "primitives": [ + { + "material": 0, + "mode": 4, + "attributes": { + "NORMAL": 0, + "POSITION": 1, + "TEXCOORD_0": 2, + "TANGENT": 3 + }, + "indices": 4 + } + ] + }, + { + "primitives": [ + { + "material": 0, + "mode": 4, + "attributes": { + "NORMAL": 5, + "POSITION": 6, + "TEXCOORD_0": 7, + "TANGENT": 8 + }, + "indices": 9 + } + ] + }, + { + "primitives": [ + { + "material": 1, + "mode": 4, + "attributes": { + "NORMAL": 10, + "POSITION": 11, + "TEXCOORD_0": 12, + "TANGENT": 13 + }, + "indices": 14 + } + ] + }, + { + "primitives": [ + { + "material": 2, + "mode": 4, + "attributes": { + "NORMAL": 15, + "POSITION": 16, + "TEXCOORD_0": 17, + "TANGENT": 18 + }, + "indices": 19 + } + ] + } + ], + "materials": [ + { + "name": "core", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.18, + 0.18, + 0.18, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + }, + "emissiveFactor": [ + 0, + 0, + 0 + ], + "occlusionTexture": { + "index": 0, + "texCoord": 0, + "strength": 0.5 + } + }, + { + "name": "material_surface", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 1, + 1, + 1, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 0 + }, + "emissiveFactor": [ + 0, + 0, + 0 + ], + "extensions": { + "KHR_materials_transmission": { + "transmissionFactor": 1 + }, + "KHR_materials_volume": { + "thicknessFactor": 8.9, + "thicknessTexture": { + "index": 2, + "texCoord": 0 + }, + "attenuationDistance": 0.01, + "attenuationColor": [ + 0.9734452903978066, + 0.9911020971136257, + 0.982250550332711 + ] + } + }, + "occlusionTexture": { + "index": 1, + "texCoord": 0, + "strength": 0.5 + } + }, + { + "name": "sss_bars", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 1, + 1, + 1, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1, + "baseColorTexture": { + "index": 3, + "texCoord": 0 + } + }, + "emissiveFactor": [ + 0, + 0, + 0 + ] + } + ], + "textures": [ + { + "sampler": 0, + "name": "core_ao.png", + "source": 0 + }, + { + "sampler": 1, + "name": "material_ao.png", + "source": 1 + }, + { + "sampler": 2, + "name": "material_thick.png", + "source": 2 + }, + { + "sampler": 3, + "name": "sss_bars.png", + "source": 3 + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 10497, + "wrapT": 10497 + }, + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 33071, + "wrapT": 33071 + }, + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 33071, + "wrapT": 33071 + }, + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 33071, + "wrapT": 33071 + } + ], + "images": [ + { + "uri": "core_ao.png", + "mimeType": "image/png", + "name": "core_ao.png" + }, + { + "uri": "material_ao.png", + "mimeType": "image/png", + "name": "material_ao.png" + }, + { + "uri": "material_thick.png", + "mimeType": "image/png", + "name": "material_thick.png" + }, + { + "uri": "sss_bars.png", + "mimeType": "image/png", + "name": "sss_bars.png" + } + ], + "extensionsUsed": [ + "KHR_materials_transmission", + "KHR_materials_volume" + ], + "extensions": {} +} \ No newline at end of file diff --git a/Models/USDShaderBallForGltf/glTF/core_ao.png b/Models/USDShaderBallForGltf/glTF/core_ao.png new file mode 100644 index 00000000..a2692f48 Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF/core_ao.png differ diff --git a/Models/USDShaderBallForGltf/glTF/material_ao.png b/Models/USDShaderBallForGltf/glTF/material_ao.png new file mode 100644 index 00000000..70ced920 Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF/material_ao.png differ diff --git a/Models/USDShaderBallForGltf/glTF/material_thick.png b/Models/USDShaderBallForGltf/glTF/material_thick.png new file mode 100644 index 00000000..a92b375e Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF/material_thick.png differ diff --git a/Models/USDShaderBallForGltf/glTF/sss_bars.png b/Models/USDShaderBallForGltf/glTF/sss_bars.png new file mode 100644 index 00000000..6b06318d Binary files /dev/null and b/Models/USDShaderBallForGltf/glTF/sss_bars.png differ diff --git a/Models/USDShaderBallForGltf/metadata.json b/Models/USDShaderBallForGltf/metadata.json new file mode 100644 index 00000000..17d40667 --- /dev/null +++ b/Models/USDShaderBallForGltf/metadata.json @@ -0,0 +1,25 @@ +{ + "version": 2, + "legal": [ + { + "license": "CC-BY 4.0", + "licenseUrl": "https://creativecommons.org/licenses/by/4.0/legalcode", + "artist": "Geometry and textures: Chris Rydalch; original specification and validation: André Mazzone; original scene, inspiration and consultation: Thomas Anagnostou; glTF conversion: Eric Chadwick", + "year": "2026", + "owner": "Eric Chadwick", + "what": "Model and textures and all images in the README.md", + "text": "CC BY 4.0 International", + "spdx": "CC-BY-4.0", + "icon": "https://licensebuttons.net/l/by/4.0/88x31.png" + } + ], + "tags": [ + "showcase", + "extension" + ], + "screenshot": "screenshot/screenshot.jpg", + "name": "USD Shader Ball for glTF", + "path": "./Models/USDShaderBallForGltf", + "summary": "USD Shader Ball converted for glTF", + "createReadme": true +} diff --git a/Models/USDShaderBallForGltf/screenshot/screenshot.jpg b/Models/USDShaderBallForGltf/screenshot/screenshot.jpg new file mode 100644 index 00000000..5f42accc Binary files /dev/null and b/Models/USDShaderBallForGltf/screenshot/screenshot.jpg differ diff --git a/Models/USDShaderBallForGltf/screenshot/screenshot_large.jpg b/Models/USDShaderBallForGltf/screenshot/screenshot_large.jpg new file mode 100644 index 00000000..d63a9064 Binary files /dev/null and b/Models/USDShaderBallForGltf/screenshot/screenshot_large.jpg differ diff --git a/Models/USDShaderBallForGltf/screenshot/screenshot_occlusion.jpg b/Models/USDShaderBallForGltf/screenshot/screenshot_occlusion.jpg new file mode 100644 index 00000000..11cff31b Binary files /dev/null and b/Models/USDShaderBallForGltf/screenshot/screenshot_occlusion.jpg differ diff --git a/Models/USDShaderBallForGltf/screenshot/screenshot_thickness.jpg b/Models/USDShaderBallForGltf/screenshot/screenshot_thickness.jpg new file mode 100644 index 00000000..6e406295 Binary files /dev/null and b/Models/USDShaderBallForGltf/screenshot/screenshot_thickness.jpg differ diff --git a/Models/USDShaderBallForGltf/screenshot/threejs-editor-lighting.jpg b/Models/USDShaderBallForGltf/screenshot/threejs-editor-lighting.jpg new file mode 100644 index 00000000..ffd47c5d Binary files /dev/null and b/Models/USDShaderBallForGltf/screenshot/threejs-editor-lighting.jpg differ