diff --git a/.gitignore b/.gitignore index 9c8f2fa..adb55f2 100644 --- a/.gitignore +++ b/.gitignore @@ -180,3 +180,7 @@ _deps *-prefix/ # End of https://www.toptal.com/developers/gitignore/api/clion,cmake,c++ + +# Blender files +*.blend +*.blend1 \ No newline at end of file diff --git a/media/scenes/grid.bin b/media/scenes/grid.bin new file mode 100644 index 0000000..761bfe4 Binary files /dev/null and b/media/scenes/grid.bin differ diff --git a/media/scenes/grid.gltf b/media/scenes/grid.gltf new file mode 100644 index 0000000..420d2a1 --- /dev/null +++ b/media/scenes/grid.gltf @@ -0,0 +1,307 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v4.1.63", + "version":"2.0" + }, + "extensionsUsed":[ + "KHR_materials_emissive_strength" + ], + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 0, + 1 + ] + } + ], + "nodes":[ + { + "mesh":0, + "name":"Base", + "scale":[ + 300, + 1, + 300 + ] + }, + { + "mesh":1, + "name":"Plane", + "scale":[ + 424.1018981933594, + 424.1018981933594, + 424.1018981933594 + ], + "translation":[ + 0, + 684.2815551757812, + 0 + ] + } + ], + "materials":[ + { + "doubleSided":true, + "name":"Material", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.800000011920929, + 0.800000011920929, + 0.800000011920929, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + }, + { + "doubleSided":true, + "emissiveFactor":[ + 1, + 1, + 1 + ], + "extensions":{ + "KHR_materials_emissive_strength":{ + "emissiveStrength":2 + } + }, + "name":"Material.001", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.800000011920929, + 0.800000011920929, + 0.800000011920929, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + } + ], + "meshes":[ + { + "name":"Cube", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3, + "material":0 + }, + { + "attributes":{ + "POSITION":4, + "NORMAL":5, + "TEXCOORD_0":6 + }, + "indices":7, + "material":0 + } + ] + }, + { + "name":"Plane", + "primitives":[ + { + "attributes":{ + "POSITION":8, + "NORMAL":9, + "TEXCOORD_0":10 + }, + "indices":11, + "material":1 + } + ] + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":180024, + "max":[ + 1, + 1, + 1 + ], + "min":[ + -1, + -1, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":1, + "componentType":5126, + "count":180024, + "type":"VEC3" + }, + { + "bufferView":2, + "componentType":5126, + "count":180024, + "type":"VEC2" + }, + { + "bufferView":3, + "componentType":5125, + "count":810036, + "type":"SCALAR" + }, + { + "bufferView":4, + "componentType":5126, + "count":360000, + "max":[ + 0.996666669845581, + 1, + 0.996666669845581 + ], + "min":[ + -0.996666669845581, + -1, + -0.996666669845581 + ], + "type":"VEC3" + }, + { + "bufferView":5, + "componentType":5126, + "count":360000, + "type":"VEC3" + }, + { + "bufferView":6, + "componentType":5126, + "count":360000, + "type":"VEC2" + }, + { + "bufferView":7, + "componentType":5125, + "count":540000, + "type":"SCALAR" + }, + { + "bufferView":8, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":9, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":10, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":11, + "componentType":5123, + "count":6, + "type":"SCALAR" + } + ], + "bufferViews":[ + { + "buffer":0, + "byteLength":2160288, + "byteOffset":0, + "target":34962 + }, + { + "buffer":0, + "byteLength":2160288, + "byteOffset":2160288, + "target":34962 + }, + { + "buffer":0, + "byteLength":1440192, + "byteOffset":4320576, + "target":34962 + }, + { + "buffer":0, + "byteLength":3240144, + "byteOffset":5760768, + "target":34963 + }, + { + "buffer":0, + "byteLength":4320000, + "byteOffset":9000912, + "target":34962 + }, + { + "buffer":0, + "byteLength":4320000, + "byteOffset":13320912, + "target":34962 + }, + { + "buffer":0, + "byteLength":2880000, + "byteOffset":17640912, + "target":34962 + }, + { + "buffer":0, + "byteLength":2160000, + "byteOffset":20520912, + "target":34963 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":22680912, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":22680960, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":22681008, + "target":34962 + }, + { + "buffer":0, + "byteLength":12, + "byteOffset":22681040, + "target":34963 + } + ], + "buffers":[ + { + "byteLength":22681052, + "uri":"grid.bin" + } + ] +} diff --git a/media/scenes/sportscar.bin b/media/scenes/sportscar.bin new file mode 100644 index 0000000..a6bdc08 Binary files /dev/null and b/media/scenes/sportscar.bin differ diff --git a/media/scenes/sportscar.glb b/media/scenes/sportscar.glb new file mode 100644 index 0000000..7b2c2a1 Binary files /dev/null and b/media/scenes/sportscar.glb differ diff --git a/media/scenes/sportscar.gltf b/media/scenes/sportscar.gltf new file mode 100644 index 0000000..14339ef --- /dev/null +++ b/media/scenes/sportscar.gltf @@ -0,0 +1,113 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v4.1.63", + "version":"2.0" + }, + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 0, + 1 + ] + } + ], + "nodes":[ + { + "name":"sportsCar" + }, + { + "mesh":0, + "name":"Plane", + "scale":[ + -4.532076835632324, + -4.532076835632324, + -4.532076835632324 + ] + } + ], + "meshes":[ + { + "name":"Plane", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3 + } + ] + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":1, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":2, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":3, + "componentType":5123, + "count":6, + "type":"SCALAR" + } + ], + "bufferViews":[ + { + "buffer":0, + "byteLength":48, + "byteOffset":0, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":48, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":96, + "target":34962 + }, + { + "buffer":0, + "byteLength":12, + "byteOffset":128, + "target":34963 + } + ], + "buffers":[ + { + "byteLength":140, + "uri":"sportscar.bin" + } + ] +} diff --git a/nvpro_core b/nvpro_core index c6583db..8002b64 160000 --- a/nvpro_core +++ b/nvpro_core @@ -1 +1 @@ -Subproject commit c6583dbe0b51a20477ad0a5558bf4909372301ab +Subproject commit 8002b64c533636abc7b950fbbcab9937c557e9a1 diff --git a/ray_tracing_gltf/main.cpp b/ray_tracing_gltf/main.cpp index e405113..17dd849 100644 --- a/ray_tracing_gltf/main.cpp +++ b/ray_tracing_gltf/main.cpp @@ -162,7 +162,7 @@ int main(int argc, char** argv) helloVk.initGUI(0); // Using sub-pass 0 // Creation of the example - helloVk.loadScene(nvh::findFile("media/scenes/cornellBox.gltf", defaultSearchPaths, true)); + helloVk.loadScene(nvh::findFile("media/scenes/grid.gltf", defaultSearchPaths, true)); helloVk.createOffscreenRender();