IAS structure suggestions for complex instancing in GLB files

panel_grid_demo.zip (5.1 KB)

I’ve created a purposely complex instancing hierarchy in the GLB file (attached) that I’m trying to translate into Optix, the text log for the structure of the file is below. Additionally, the end user will provide another instance transform for the contents of this file to place it somewhere in the world.

I see three options moving forward but if there is a better one, I’m all ears.

  1. Mimic the instances using IAS(user) → IAS(glb) → IAS(glb) → IAS(glb) → GAS for each object I want in the world. The only reason I would do this is if OptixInstance supported multiple children like the GLB file does but I don’t think that is true.
  2. Compress all of the GLB instance transforms with IAS(user) → IAS(glb) → GAS.
  3. I could also compress the user transform so I’d just have one level of IAS like IAS(user) → GAS

I’m guessing the answer is #3 but I wanted to make sure I wasn’t overlooking a better approach.

Thank you.

[info] LoadModels: Successfully loaded 85 instances and 3 primitives from model 'panels'
[debug] LoadModels: Instance 0: 'Section_0' - mesh_index: -1, parent: -1, children: [1, 6, 11, 16]
[debug]   Rotation matrix: [0.988, 0.000, 0.241] [0.000, 1.017, 0.000] [-0.241, 0.000, 0.988]
[debug]   Translation: (-7.000, 0.000, -7.000)
[debug]   Scale: (1.017, 1.017, 1.017)
[debug] LoadModels: Instance 1: 'S0_Group_0_0' - mesh_index: -1, parent: 0, children: [2, 3, 4, 5]
[debug]   Rotation matrix: [0.504, 0.000, 0.782] [0.000, 0.930, 0.000] [-0.782, 0.000, 0.504]
[debug]   Translation: (-19.293, 0.000, -14.472)
[debug]   Scale: (0.930, 0.930, 0.930)
[debug] LoadModels: Instance 2: 'S0_G00_Panel_0_0' - mesh_index: 0, parent: 1, children: []
[debug]   Rotation matrix: [0.428, 0.000, 0.844] [0.000, 0.947, 0.000] [-0.844, 0.000, 0.428]
[debug]   Translation: (-33.763, 0.000, -11.351)
[debug]   Scale: (0.947, 0.947, 0.947)
[debug] LoadModels: Instance 3: 'S0_G00_Panel_0_1' - mesh_index: 0, parent: 1, children: []
[debug]   Rotation matrix: [0.714, 0.000, 0.330] [0.000, 0.786, 0.000] [-0.330, 0.000, 0.714]
[debug]   Translation: (-32.502, 0.000, -13.305)
[debug]   Scale: (0.786, 0.786, 0.786)
[debug] LoadModels: Instance 4: 'S0_G00_Panel_1_0' - mesh_index: 1, parent: 1, children: []
[debug]   Rotation matrix: [-0.257, 0.000, -0.931] [0.000, 0.966, 0.000] [0.931, 0.000, -0.257]
[debug]   Translation: (-31.809, 0.000, -10.090)
[debug]   Scale: (0.966, 0.966, 0.966)
[debug] LoadModels: Instance 5: 'S0_G00_Panel_1_1' - mesh_index: 1, parent: 1, children: []
[debug]   Rotation matrix: [0.324, 0.000, 0.968] [0.000, 1.021, 0.000] [-0.968, 0.000, 0.324]
[debug]   Translation: (-30.548, 0.000, -12.044)
[debug]   Scale: (1.021, 1.021, 1.021)
[debug] LoadModels: Instance 6: 'S0_Group_0_1' - mesh_index: -1, parent: 0, children: [7, 8, 9, 10]
[debug]   Rotation matrix: [0.680, 0.000, 0.659] [0.000, 0.947, 0.000] [-0.659, 0.000, 0.680]
[debug]   Translation: (-13.363, 0.000, -15.918)
[debug]   Scale: (0.947, 0.947, 0.947)
[debug] LoadModels: Instance 7: 'S0_G01_Panel_0_0' - mesh_index: 1, parent: 6, children: []
[debug]   Rotation matrix: [-0.788, 0.000, -0.451] [0.000, 0.908, 0.000] [0.451, 0.000, -0.788]
[debug]   Translation: (-24.348, 0.000, -20.109)
[debug]   Scale: (0.908, 0.908, 0.908)
[debug] LoadModels: Instance 8: 'S0_G01_Panel_0_1' - mesh_index: 1, parent: 6, children: []
[debug]   Rotation matrix: [-1.101, 0.000, -0.200] [0.000, 1.119, 0.000] [0.200, 0.000, -1.101]
[debug]   Translation: (-22.648, 0.000, -21.757)
[debug]   Scale: (1.119, 1.119, 1.119)
[debug] LoadModels: Instance 9: 'S0_G01_Panel_1_0' - mesh_index: 1, parent: 6, children: []
[debug]   Rotation matrix: [0.207, 0.000, -0.894] [0.000, 0.918, 0.000] [0.894, 0.000, 0.207]
[debug]   Translation: (-22.701, 0.000, -18.409)
[debug]   Scale: (0.918, 0.918, 0.918)
[debug] LoadModels: Instance 10: 'S0_G01_Panel_1_1' - mesh_index: 1, parent: 6, children: []
[debug]   Rotation matrix: [-0.774, 0.000, 0.493] [0.000, 0.918, 0.000] [-0.493, 0.000, -0.774]
[debug]   Translation: (-21.000, 0.000, -20.057)
[debug]   Scale: (0.918, 0.918, 0.918)
[debug] LoadModels: Instance 11: 'S0_Group_1_0' - mesh_index: -1, parent: 0, children: [12, 13, 14, 15]
[debug]   Rotation matrix: [0.564, 0.000, 0.858] [0.000, 1.027, 0.000] [-0.858, 0.000, 0.564]
[debug]   Translation: (-17.846, 0.000, -8.542)
[debug]   Scale: (1.027, 1.027, 1.027)
[debug] LoadModels: Instance 12: 'S0_G10_Panel_0_0' - mesh_index: 1, parent: 11, children: []
[debug]   Rotation matrix: [0.947, 0.000, 0.060] [0.000, 0.949, 0.000] [-0.060, 0.000, 0.947]
[debug]   Translation: (-28.695, 0.000, -1.851)
[debug]   Scale: (0.949, 0.949, 0.949)
[debug] LoadModels: Instance 13: 'S0_G10_Panel_0_1' - mesh_index: 1, parent: 11, children: []
[debug]   Rotation matrix: [-0.686, 0.000, -0.645] [0.000, 0.941, 0.000] [0.645, 0.000, -0.686]
[debug]   Translation: (-27.285, 0.000, -3.996)
[debug]   Scale: (0.941, 0.941, 0.941)
[debug] LoadModels: Instance 14: 'S0_G10_Panel_1_0' - mesh_index: 1, parent: 11, children: []
[debug]   Rotation matrix: [0.604, 0.000, 0.566] [0.000, 0.828, 0.000] [-0.566, 0.000, 0.604]
[debug]   Translation: (-26.550, 0.000, -0.441)
[debug]   Scale: (0.828, 0.828, 0.828)
[debug] LoadModels: Instance 15: 'S0_G10_Panel_1_1' - mesh_index: 0, parent: 11, children: []
[debug]   Rotation matrix: [-0.923, 0.000, 0.239] [0.000, 0.953, 0.000] [-0.239, 0.000, -0.923]
[debug]   Translation: (-25.140, 0.000, -2.586)
[debug]   Scale: (0.953, 0.953, 0.953)
[debug] LoadModels: Instance 16: 'S0_Group_1_1' - mesh_index: -1, parent: 0, children: [17, 18, 19, 20]
[debug]   Rotation matrix: [0.797, 0.000, 0.530] [0.000, 0.957, 0.000] [-0.530, 0.000, 0.797]
[debug]   Translation: (-11.917, 0.000, -9.989)
[debug]   Scale: (0.957, 0.957, 0.957)
[debug] LoadModels: Instance 17: 'S0_G11_Panel_0_0' - mesh_index: 0, parent: 16, children: []
[debug]   Rotation matrix: [0.002, 0.000, -1.005] [0.000, 1.005, 0.000] [1.005, 0.000, 0.002]
[debug]   Translation: (-18.886, 0.000, -11.390)
[debug]   Scale: (1.005, 1.005, 1.005)
[debug] LoadModels: Instance 18: 'S0_G11_Panel_0_1' - mesh_index: 0, parent: 16, children: []
[debug]   Rotation matrix: [1.049, 0.000, 0.149] [0.000, 1.060, 0.000] [-0.149, 0.000, 1.049]
[debug]   Translation: (-16.893, 0.000, -12.715)
[debug]   Scale: (1.060, 1.060, 1.060)
[debug] LoadModels: Instance 19: 'S0_G11_Panel_1_0' - mesh_index: 1, parent: 16, children: []
[debug]   Rotation matrix: [0.376, 0.000, -0.810] [0.000, 0.893, 0.000] [0.810, 0.000, 0.376]
[debug]   Translation: (-17.560, 0.000, -9.397)
[debug]   Scale: (0.893, 0.893, 0.893)
[debug] LoadModels: Instance 20: 'S0_G11_Panel_1_1' - mesh_index: 1, parent: 16, children: []
[debug]   Rotation matrix: [-0.512, 0.000, -0.925] [0.000, 1.057, 0.000] [0.925, 0.000, -0.512]
[debug]   Translation: (-15.567, 0.000, -10.723)
[debug]   Scale: (1.057, 1.057, 1.057)
[debug] LoadModels: Instance 21: 'Section_1' - mesh_index: -1, parent: -1, children: [22, 27, 32, 37]
[debug]   Rotation matrix: [0.968, 0.000, 0.359] [0.000, 1.032, 0.000] [-0.359, 0.000, 0.968]
[debug]   Translation: (7.000, 0.000, -7.000)
[debug]   Scale: (1.032, 1.032, 1.032)
[debug] LoadModels: Instance 22: 'S1_Group_0_0' - mesh_index: -1, parent: 21, children: [23, 24, 25, 26]
[debug]   Rotation matrix: [0.912, 0.000, 0.439] [0.000, 1.012, 0.000] [-0.439, 0.000, 0.912]
[debug]   Translation: (7.278, 0.000, -18.112)
[debug]   Scale: (1.012, 1.012, 1.012)
[debug] LoadModels: Instance 23: 'S1_G00_Panel_0_0' - mesh_index: 0, parent: 22, children: []
[debug]   Rotation matrix: [0.909, 0.000, -0.333] [0.000, 0.968, 0.000] [0.333, 0.000, 0.909]
[debug]   Translation: (4.844, 0.000, -29.580)
[debug]   Scale: (0.968, 0.968, 0.968)
[debug] LoadModels: Instance 24: 'S1_G00_Panel_0_1' - mesh_index: 0, parent: 22, children: []
[debug]   Rotation matrix: [0.338, 0.000, -0.799] [0.000, 0.868, 0.000] [0.799, 0.000, 0.338]
[debug]   Translation: (7.124, 0.000, -30.679)
[debug]   Scale: (0.868, 0.868, 0.868)
[debug] LoadModels: Instance 25: 'S1_G00_Panel_1_0' - mesh_index: 1, parent: 22, children: []
[debug]   Rotation matrix: [-0.841, 0.000, 0.452] [0.000, 0.955, 0.000] [-0.452, 0.000, -0.841]
[debug]   Translation: (5.942, 0.000, -27.300)
[debug]   Scale: (0.955, 0.955, 0.955)
[debug] LoadModels: Instance 26: 'S1_G00_Panel_1_1' - mesh_index: 1, parent: 22, children: []
[debug]   Rotation matrix: [0.595, 0.000, -0.650] [0.000, 0.881, 0.000] [0.650, 0.000, 0.595]
[debug]   Translation: (8.222, 0.000, -28.399)
[debug]   Scale: (0.881, 0.881, 0.881)
[debug] LoadModels: Instance 27: 'S1_Group_0_1' - mesh_index: -1, parent: 21, children: [28, 29, 30, 31]
[debug]   Rotation matrix: [0.737, 0.000, 0.842] [0.000, 1.119, 0.000] [-0.842, 0.000, 0.737]
[debug]   Translation: (13.084, 0.000, -20.267)
[debug]   Scale: (1.119, 1.119, 1.119)
[debug] LoadModels: Instance 28: 'S1_G01_Panel_0_0' - mesh_index: 1, parent: 27, children: []
[debug]   Rotation matrix: [0.718, 0.000, -0.879] [0.000, 1.135, 0.000] [0.879, 0.000, 0.718]
[debug]   Translation: (10.068, 0.000, -35.926)
[debug]   Scale: (1.135, 1.135, 1.135)
[debug] LoadModels: Instance 29: 'S1_G01_Panel_0_1' - mesh_index: 1, parent: 27, children: []
[debug]   Rotation matrix: [-1.265, 0.000, -0.220] [0.000, 1.284, 0.000] [0.220, 0.000, -1.265]
[debug]   Translation: (11.912, 0.000, -38.029)
[debug]   Scale: (1.284, 1.284, 1.284)
[debug] LoadModels: Instance 30: 'S1_G01_Panel_1_0' - mesh_index: 1, parent: 27, children: []
[debug]   Rotation matrix: [-1.266, 0.000, -0.058] [0.000, 1.268, 0.000] [0.058, 0.000, -1.266]
[debug]   Translation: (12.172, 0.000, -34.082)
[debug]   Scale: (1.268, 1.268, 1.268)
[debug] LoadModels: Instance 31: 'S1_G01_Panel_1_1' - mesh_index: 0, parent: 27, children: []
[debug]   Rotation matrix: [-0.668, 0.000, -1.110] [0.000, 1.296, 0.000] [1.110, 0.000, -0.668]
[debug]   Translation: (14.015, 0.000, -36.186)
[debug]   Scale: (1.296, 1.296, 1.296)
[debug] LoadModels: Instance 32: 'S1_Group_1_0' - mesh_index: -1, parent: 21, children: [33, 34, 35, 36]
[debug]   Rotation matrix: [0.602, 0.000, 0.806] [0.000, 1.007, 0.000] [-0.806, 0.000, 0.602]
[debug]   Translation: (9.434, 0.000, -12.307)
[debug]   Scale: (1.007, 1.007, 1.007)
[debug] LoadModels: Instance 33: 'S1_G10_Panel_0_0' - mesh_index: 0, parent: 32, children: []
[debug]   Rotation matrix: [1.033, 0.000, -0.477] [0.000, 1.138, 0.000] [0.477, 0.000, 1.033]
[debug]   Translation: (6.856, 0.000, -17.687)
[debug]   Scale: (1.138, 1.138, 1.138)
[debug] LoadModels: Instance 34: 'S1_G10_Panel_0_1' - mesh_index: 0, parent: 32, children: []
[debug]   Rotation matrix: [0.101, 0.000, -1.046] [0.000, 1.051, 0.000] [1.046, 0.000, 0.101]
[debug]   Translation: (8.362, 0.000, -19.704)
[debug]   Scale: (1.051, 1.051, 1.051)
[debug] LoadModels: Instance 35: 'S1_G10_Panel_1_0' - mesh_index: 1, parent: 32, children: []
[debug]   Rotation matrix: [-0.170, 0.000, -1.151] [0.000, 1.163, 0.000] [1.151, 0.000, -0.170]
[debug]   Translation: (8.872, 0.000, -16.181)
[debug]   Scale: (1.163, 1.163, 1.163)
[debug] LoadModels: Instance 36: 'S1_G10_Panel_1_1' - mesh_index: 1, parent: 32, children: []
[debug]   Rotation matrix: [-0.995, 0.000, 0.512] [0.000, 1.119, 0.000] [-0.512, 0.000, -0.995]
[debug]   Translation: (10.378, 0.000, -18.198)
[debug]   Scale: (1.119, 1.119, 1.119)
[debug] LoadModels: Instance 37: 'S1_Group_1_1' - mesh_index: -1, parent: 21, children: [38, 39, 40, 41]
[debug]   Rotation matrix: [0.761, 0.000, 0.603] [0.000, 0.971, 0.000] [-0.603, 0.000, 0.761]
[debug]   Translation: (15.239, 0.000, -14.462)
[debug]   Scale: (0.971, 0.971, 0.971)
[debug] LoadModels: Instance 38: 'S1_G11_Panel_0_0' - mesh_index: 1, parent: 37, children: []
[debug]   Rotation matrix: [-0.856, 0.000, 0.721] [0.000, 1.119, 0.000] [-0.721, 0.000, -0.856]
[debug]   Translation: (18.737, 0.000, -23.734)
[debug]   Scale: (1.119, 1.119, 1.119)
[debug] LoadModels: Instance 39: 'S1_G11_Panel_0_1' - mesh_index: 1, parent: 37, children: []
[debug]   Rotation matrix: [0.778, 0.000, -0.714] [0.000, 1.056, 0.000] [0.714, 0.000, 0.778]
[debug]   Translation: (20.641, 0.000, -25.241)
[debug]   Scale: (1.056, 1.056, 1.056)
[debug] LoadModels: Instance 40: 'S1_G11_Panel_1_0' - mesh_index: 1, parent: 37, children: []
[debug]   Rotation matrix: [0.617, 0.000, -0.915] [0.000, 1.104, 0.000] [0.915, 0.000, 0.617]
[debug]   Translation: (20.244, 0.000, -21.831)
[debug]   Scale: (1.104, 1.104, 1.104)
[debug] LoadModels: Instance 41: 'S1_G11_Panel_1_1' - mesh_index: 0, parent: 37, children: []
[debug]   Rotation matrix: [-0.480, 0.000, 1.021] [0.000, 1.128, 0.000] [-1.021, 0.000, -0.480]
[debug]   Translation: (22.148, 0.000, -23.338)
[debug]   Scale: (1.128, 1.128, 1.128)
[debug] LoadModels: Instance 42: 'Section_2' - mesh_index: -1, parent: -1, children: [43, 48, 53, 58]
[debug]   Rotation matrix: [0.959, 0.000, 0.107] [0.000, 0.965, 0.000] [-0.107, 0.000, 0.959]
[debug]   Translation: (-7.000, 0.000, 7.000)
[debug]   Scale: (0.965, 0.965, 0.965)
[debug] LoadModels: Instance 43: 'S2_Group_0_0' - mesh_index: -1, parent: 42, children: [44, 45, 46, 47]
[debug]   Rotation matrix: [0.616, 0.000, 0.661] [0.000, 0.904, 0.000] [-0.661, 0.000, 0.616]
[debug]   Translation: (-16.157, 0.000, 11.908)
[debug]   Scale: (0.904, 0.904, 0.904)
[debug] LoadModels: Instance 44: 'S2_G00_Panel_0_0' - mesh_index: 0, parent: 43, children: []
[debug]   Rotation matrix: [0.639, 0.000, 0.718] [0.000, 0.961, 0.000] [-0.718, 0.000, 0.639]
[debug]   Translation: (-21.270, 0.000, 21.042)
[debug]   Scale: (0.961, 0.961, 0.961)
[debug] LoadModels: Instance 45: 'S2_G00_Panel_0_1' - mesh_index: 0, parent: 43, children: []
[debug]   Rotation matrix: [-0.758, 0.000, 0.084] [0.000, 0.763, 0.000] [-0.084, 0.000, -0.758]
[debug]   Translation: (-19.730, 0.000, 19.388)
[debug]   Scale: (0.763, 0.763, 0.763)
[debug] LoadModels: Instance 46: 'S2_G00_Panel_1_0' - mesh_index: 0, parent: 43, children: []
[debug]   Rotation matrix: [1.040, 0.000, 0.288] [0.000, 1.080, 0.000] [-0.288, 0.000, 1.040]
[debug]   Translation: (-19.617, 0.000, 22.582)
[debug]   Scale: (1.080, 1.080, 1.080)
[debug] LoadModels: Instance 47: 'S2_G00_Panel_1_1' - mesh_index: 1, parent: 43, children: []
[debug]   Rotation matrix: [-1.041, 0.000, 0.197] [0.000, 1.059, 0.000] [-0.197, 0.000, -1.041]
[debug]   Translation: (-18.076, 0.000, 20.929)
[debug]   Scale: (1.059, 1.059, 1.059)
[debug] LoadModels: Instance 48: 'S2_Group_0_1' - mesh_index: -1, parent: 42, children: [49, 50, 51, 52]
[debug]   Rotation matrix: [0.620, 0.000, 0.709] [0.000, 0.942, 0.000] [-0.709, 0.000, 0.620]
[debug]   Translation: (-10.405, 0.000, 11.264)
[debug]   Scale: (0.942, 0.942, 0.942)
[debug] LoadModels: Instance 49: 'S2_G01_Panel_0_0' - mesh_index: 0, parent: 48, children: []
[debug]   Rotation matrix: [-0.068, 0.000, -0.909] [0.000, 0.912, 0.000] [0.909, 0.000, -0.068]
[debug]   Translation: (-11.710, 0.000, 16.692)
[debug]   Scale: (0.912, 0.912, 0.912)
[debug] LoadModels: Instance 50: 'S2_G01_Panel_0_1' - mesh_index: 1, parent: 48, children: []
[debug]   Rotation matrix: [0.791, 0.000, 0.681] [0.000, 1.044, 0.000] [-0.681, 0.000, 0.791]
[debug]   Translation: (-10.160, 0.000, 14.919)
[debug]   Scale: (1.044, 1.044, 1.044)
[debug] LoadModels: Instance 51: 'S2_G01_Panel_1_0' - mesh_index: 0, parent: 48, children: []
[debug]   Rotation matrix: [-0.803, 0.000, -0.478] [0.000, 0.934, 0.000] [0.478, 0.000, -0.803]
[debug]   Translation: (-9.937, 0.000, 18.242)
[debug]   Scale: (0.934, 0.934, 0.934)
[debug] LoadModels: Instance 52: 'S2_G01_Panel_1_1' - mesh_index: 1, parent: 48, children: []
[debug]   Rotation matrix: [-0.886, 0.000, -0.051] [0.000, 0.887, 0.000] [0.051, 0.000, -0.886]
[debug]   Translation: (-8.387, 0.000, 16.469)
[debug]   Scale: (0.887, 0.887, 0.887)
[debug] LoadModels: Instance 53: 'S2_Group_1_0' - mesh_index: -1, parent: 42, children: [54, 55, 56, 57]
[debug]   Rotation matrix: [0.793, 0.000, 0.501] [0.000, 0.938, 0.000] [-0.501, 0.000, 0.793]
[debug]   Translation: (-15.513, 0.000, 17.660)
[debug]   Scale: (0.938, 0.938, 0.938)
[debug] LoadModels: Instance 54: 'S2_G10_Panel_0_0' - mesh_index: 1, parent: 53, children: []
[debug]   Rotation matrix: [-0.217, 0.000, -0.978] [0.000, 1.001, 0.000] [0.978, 0.000, -0.217]
[debug]   Translation: (-20.051, 0.000, 30.231)
[debug]   Scale: (1.001, 1.001, 1.001)
[debug] LoadModels: Instance 55: 'S2_G10_Panel_0_1' - mesh_index: 1, parent: 53, children: []
[debug]   Rotation matrix: [0.747, 0.000, -0.295] [0.000, 0.803, 0.000] [0.295, 0.000, 0.747]
[debug]   Translation: (-18.069, 0.000, 28.979)
[debug]   Scale: (0.803, 0.803, 0.803)
[debug] LoadModels: Instance 56: 'S2_G10_Panel_1_0' - mesh_index: 1, parent: 53, children: []
[debug]   Rotation matrix: [-0.342, 0.000, -0.903] [0.000, 0.966, 0.000] [0.903, 0.000, -0.342]
[debug]   Translation: (-18.799, 0.000, 32.213)
[debug]   Scale: (0.966, 0.966, 0.966)
[debug] LoadModels: Instance 57: 'S2_G10_Panel_1_1' - mesh_index: 0, parent: 53, children: []
[debug]   Rotation matrix: [-0.892, 0.000, -0.237] [0.000, 0.923, 0.000] [0.237, 0.000, -0.892]
[debug]   Translation: (-16.817, 0.000, 30.961)
[debug]   Scale: (0.923, 0.923, 0.923)
[debug] LoadModels: Instance 58: 'S2_Group_1_1' - mesh_index: -1, parent: 42, children: [59, 60, 61, 62]
[debug]   Rotation matrix: [0.743, 0.000, 0.452] [0.000, 0.869, 0.000] [-0.452, 0.000, 0.743]
[debug]   Translation: (-9.761, 0.000, 17.016)
[debug]   Scale: (0.869, 0.869, 0.869)
[debug] LoadModels: Instance 59: 'S2_G11_Panel_0_0' - mesh_index: 0, parent: 58, children: []
[debug]   Rotation matrix: [0.202, 0.000, 0.777] [0.000, 0.803, 0.000] [-0.777, 0.000, 0.202]
[debug]   Translation: (-9.710, 0.000, 25.888)
[debug]   Scale: (0.803, 0.803, 0.803)
[debug] LoadModels: Instance 60: 'S2_G11_Panel_0_1' - mesh_index: 0, parent: 58, children: []
[debug]   Rotation matrix: [-0.352, 0.000, -0.601] [0.000, 0.696, 0.000] [0.601, 0.000, -0.352]
[debug]   Translation: (-7.852, 0.000, 24.758)
[debug]   Scale: (0.696, 0.696, 0.696)
[debug] LoadModels: Instance 61: 'S2_G11_Panel_1_0' - mesh_index: 1, parent: 58, children: []
[debug]   Rotation matrix: [0.758, 0.000, -0.193] [0.000, 0.782, 0.000] [0.193, 0.000, 0.758]
[debug]   Translation: (-8.580, 0.000, 27.745)
[debug]   Scale: (0.782, 0.782, 0.782)
[debug] LoadModels: Instance 62: 'S2_G11_Panel_1_1' - mesh_index: 1, parent: 58, children: []
[debug]   Rotation matrix: [0.348, 0.000, 0.742] [0.000, 0.819, 0.000] [-0.742, 0.000, 0.348]
[debug]   Translation: (-6.723, 0.000, 26.616)
[debug]   Scale: (0.819, 0.819, 0.819)
[debug] LoadModels: Instance 63: 'Section_3' - mesh_index: -1, parent: -1, children: [64, 69, 74, 79]
[debug]   Rotation matrix: [0.876, 0.000, 0.475] [0.000, 0.996, 0.000] [-0.475, 0.000, 0.876]
[debug]   Translation: (7.000, 0.000, 7.000)
[debug]   Scale: (0.996, 0.996, 0.996)
[debug] LoadModels: Instance 64: 'S3_Group_0_0' - mesh_index: -1, parent: 63, children: [65, 66, 67, 68]
[debug]   Rotation matrix: [0.632, 0.000, 0.657] [0.000, 0.912, 0.000] [-0.657, 0.000, 0.632]
[debug]   Translation: (12.403, 0.000, 8.604)
[debug]   Scale: (0.912, 0.912, 0.912)
[debug] LoadModels: Instance 65: 'S3_G00_Panel_0_0' - mesh_index: 0, parent: 64, children: []
[debug]   Rotation matrix: [-0.430, 0.000, 0.595] [0.000, 0.734, 0.000] [-0.595, 0.000, -0.430]
[debug]   Translation: (15.948, 0.000, 8.535)
[debug]   Scale: (0.734, 0.734, 0.734)
[debug] LoadModels: Instance 66: 'S3_G00_Panel_0_1' - mesh_index: 0, parent: 64, children: []
[debug]   Rotation matrix: [-0.169, 0.000, -0.851] [0.000, 0.868, 0.000] [0.851, 0.000, -0.169]
[debug]   Translation: (17.528, 0.000, 6.893)
[debug]   Scale: (0.868, 0.868, 0.868)
[debug] LoadModels: Instance 67: 'S3_G00_Panel_1_0' - mesh_index: 1, parent: 64, children: []
[debug]   Rotation matrix: [0.470, 0.000, -0.613] [0.000, 0.773, 0.000] [0.613, 0.000, 0.470]
[debug]   Translation: (17.590, 0.000, 10.115)
[debug]   Scale: (0.773, 0.773, 0.773)
[debug] LoadModels: Instance 68: 'S3_G00_Panel_1_1' - mesh_index: 0, parent: 64, children: []
[debug]   Rotation matrix: [-0.063, 0.000, -0.773] [0.000, 0.776, 0.000] [0.773, 0.000, -0.063]
[debug]   Translation: (19.170, 0.000, 8.473)
[debug]   Scale: (0.776, 0.776, 0.776)
[debug] LoadModels: Instance 69: 'S3_Group_0_1' - mesh_index: -1, parent: 63, children: [70, 71, 72, 73]
[debug]   Rotation matrix: [0.753, 0.000, 0.617] [0.000, 0.973, 0.000] [-0.617, 0.000, 0.753]
[debug]   Translation: (17.657, 0.000, 5.754)
[debug]   Scale: (0.973, 0.973, 0.973)
[debug] LoadModels: Instance 70: 'S3_G01_Panel_0_0' - mesh_index: 0, parent: 69, children: []
[debug]   Rotation matrix: [0.644, 0.000, -0.604] [0.000, 0.883, 0.000] [0.604, 0.000, 0.644]
[debug]   Translation: (25.941, 0.000, 2.422)
[debug]   Scale: (0.883, 0.883, 0.883)
[debug] LoadModels: Instance 71: 'S3_G01_Panel_0_1' - mesh_index: 1, parent: 69, children: []
[debug]   Rotation matrix: [-0.847, 0.000, 0.406] [0.000, 0.939, 0.000] [-0.406, 0.000, -0.847]
[debug]   Translation: (27.822, 0.000, 0.879)
[debug]   Scale: (0.939, 0.939, 0.939)
[debug] LoadModels: Instance 72: 'S3_G01_Panel_1_0' - mesh_index: 0, parent: 69, children: []
[debug]   Rotation matrix: [0.500, 0.000, -0.661] [0.000, 0.829, 0.000] [0.661, 0.000, 0.500]
[debug]   Translation: (27.484, 0.000, 4.304)
[debug]   Scale: (0.829, 0.829, 0.829)
[debug] LoadModels: Instance 73: 'S3_G01_Panel_1_1' - mesh_index: 1, parent: 69, children: []
[debug]   Rotation matrix: [0.661, 0.000, 0.477] [0.000, 0.815, 0.000] [-0.477, 0.000, 0.661]
[debug]   Translation: (29.365, 0.000, 2.760)
[debug]   Scale: (0.815, 0.815, 0.815)
[debug] LoadModels: Instance 74: 'S3_Group_1_0' - mesh_index: -1, parent: 63, children: [75, 76, 77, 78]
[debug]   Rotation matrix: [0.754, 0.000, 0.786] [0.000, 1.089, 0.000] [-0.786, 0.000, 0.754]
[debug]   Translation: (15.252, 0.000, 13.858)
[debug]   Scale: (1.089, 1.089, 1.089)
[debug] LoadModels: Instance 75: 'S3_G10_Panel_0_0' - mesh_index: 1, parent: 74, children: []
[debug]   Rotation matrix: [0.978, 0.000, 0.389] [0.000, 1.053, 0.000] [-0.389, 0.000, 0.978]
[debug]   Translation: (24.203, 0.000, 18.297)
[debug]   Scale: (1.053, 1.053, 1.053)
[debug] LoadModels: Instance 76: 'S3_G10_Panel_0_1' - mesh_index: 1, parent: 74, children: []
[debug]   Rotation matrix: [-0.933, 0.000, -0.258] [0.000, 0.968, 0.000] [0.258, 0.000, -0.933]
[debug]   Translation: (26.089, 0.000, 16.332)
[debug]   Scale: (0.968, 0.968, 0.968)
[debug] LoadModels: Instance 77: 'S3_G10_Panel_1_0' - mesh_index: 0, parent: 74, children: []
[debug]   Rotation matrix: [0.650, 0.000, -0.999] [0.000, 1.191, 0.000] [0.999, 0.000, 0.650]
[debug]   Translation: (26.168, 0.000, 20.183)
[debug]   Scale: (1.191, 1.191, 1.191)
[debug] LoadModels: Instance 78: 'S3_G10_Panel_1_1' - mesh_index: 1, parent: 74, children: []
[debug]   Rotation matrix: [-0.982, 0.000, 0.385] [0.000, 1.054, 0.000] [-0.385, 0.000, -0.982]
[debug]   Translation: (28.054, 0.000, 18.218)
[debug]   Scale: (1.054, 1.054, 1.054)
[debug] LoadModels: Instance 79: 'S3_Group_1_1' - mesh_index: -1, parent: 63, children: [80, 81, 82, 83]
[debug]   Rotation matrix: [0.487, 0.000, 0.917] [0.000, 1.038, 0.000] [-0.917, 0.000, 0.487]
[debug]   Translation: (20.507, 0.000, 11.009)
[debug]   Scale: (1.038, 1.038, 1.038)
[debug] LoadModels: Instance 80: 'S3_G11_Panel_0_0' - mesh_index: 1, parent: 79, children: []
[debug]   Rotation matrix: [-0.336, 0.000, -1.195] [0.000, 1.241, 0.000] [1.195, 0.000, -0.336]
[debug]   Translation: (32.791, 0.000, 7.244)
[debug]   Scale: (1.241, 1.241, 1.241)
[debug] LoadModels: Instance 81: 'S3_G11_Panel_0_1' - mesh_index: 0, parent: 79, children: []
[debug]   Rotation matrix: [-0.945, 0.000, 0.195] [0.000, 0.965, 0.000] [-0.195, 0.000, -0.945]
[debug]   Translation: (34.008, 0.000, 4.951)
[debug]   Scale: (0.965, 0.965, 0.965)
[debug] LoadModels: Instance 82: 'S3_G11_Panel_1_0' - mesh_index: 1, parent: 79, children: []
[debug]   Rotation matrix: [-1.091, 0.000, -0.440] [0.000, 1.177, 0.000] [0.440, 0.000, -1.091]
[debug]   Translation: (35.084, 0.000, 8.460)
[debug]   Scale: (1.177, 1.177, 1.177)
[debug] LoadModels: Instance 83: 'S3_G11_Panel_1_1' - mesh_index: 0, parent: 79, children: []
[debug]   Rotation matrix: [1.096, 0.000, 0.039] [0.000, 1.097, 0.000] [-0.039, 0.000, 1.096]
[debug]   Translation: (36.301, 0.000, 6.168)
[debug]   Scale: (1.097, 1.097, 1.097)
[debug] LoadModels: Instance 84: 'Viewpoint' - mesh_index: -1, parent: -1, children: []
[debug]   Rotation matrix: [0.682, -0.393, 0.617] [-0.056, 0.813, 0.579] [-0.729, -0.430, 0.533]
[debug]   Translation: (20.000, 15.000, 20.000)
[debug]   Scale: (1.000, 1.000, 1.000)
[debug] LoadModels: Primitive 0: 'Mesh_1_primitive_0' - 4 vertices, 6 indices, 2 triangles
[debug]   Mesh index: 0, Primitive index: 0, Material index: 0 ('dirt')
[debug]   Has normals: true, Has texcoords: true
[debug]   AABB: (-1.000, 0.000, -1.000) to (1.000, 0.000, 1.000)
[debug] LoadModels: Primitive 1: 'Mesh_0_primitive_0' - 3 vertices, 3 indices, 1 triangles
[debug]   Mesh index: 1, Primitive index: 0, Material index: 1 ('metal')
[debug]   Has normals: true, Has texcoords: true
[debug]   AABB: (-1.000, 0.000, -1.000) to (1.000, 0.000, 1.000)
[debug] LoadModels: Primitive 2: 'Mesh_0_primitive_1' - 3 vertices, 3 indices, 1 triangles
[debug]   Mesh index: 1, Primitive index: 1, Material index: 2 ('glass')
[debug]   Has normals: true, Has texcoords: true
[debug]   AABB: (-1.000, 0.000, -1.000) to (1.000, 0.000, 1.000)
[debug] LoadModels: Applying model-level transformations to 85 instances and 3 primitives
[debug] LoadModels: Applying rotation matrix
[debug] LoadModels: Applying scale: (0.000, 0.000, 0.000)
[debug] LoadModels: Applied transformations to 85 instances and 3 primitives, recalculated AABBs

Hi Michael,

Those are probably the three main options. There is a 4th option, you could bake all transformed geometry into a single self-contained GAS and trace it without an IAS. For your purposes that’s probably worse, not better, but I mention it for the sake of completeness. For best performance, we currently recommend using exactly one level of instancing (option 3), no more, no less. If that reduces flexibility or increases memory too much, then the choice between options 1 and 2 are more up to you and your goals and constraints.

These options are tradeoffs between convenience and performance. Baking the transforms in the input scene down to a single IAS can of course lead to inconvenient limitations on how you deal with changes to the scene, such as animation. For example in option 1, if the middle of the glb IASes is animated, then baking it down to a single IAS means you need to spend a little time in the scene setup phase doing that baking, and that you’ll need to figure out how to combine your static and animated transforms.

OptiX is designed to handle multi-level instancing, but every extra level does come with some small traversal cost which can add up if there are many levels. If there is any reuse in your scene, then of course you can end up with an exponential number of transforms.

So, option 1 is easiest and most flexible, and option 3 has the highest traversal performance at the cost of the compute & memory needed to flatten, and potentially some loss of convenience, depending on what you’re doing and what your scenes look like. Option 2 doesn’t have a lot of advantages other than memory savings compared to option 1, and it might end up being confusing. Doing both 1 & 3 might not be too tough, and you’d be able to measure the differences…


David.

Hey David.

Thank you for the detailed response. I hadn’t seen the instance layout on the left before. I’m inclined to follow that one to keep the total number of instances from going exponential as you mentioned. Now I’m thinking I should lay it out like below. I can still compress the multiple levels of instances that are inside the GLB file but keeping those separate from the user defined instances will give me the freedom to use motion in the future. I don’t think I’ve seen an example of this in the SDK. Can you point me to one if it exists?

There’s a little bit of instancing in the optixDynamicGeometry sample, and one instance (a static tessellated sphere) that is reused and displayed as 2 speres. Right now we don’t have a sample that demonstrates sophisticated multi-level instancing, though we maybe should publish one. Having done it before, it’s a fun exercise to ray-trace a fractal made of quadrillions of teapots by using multi-level instancing with excessive sharing. ;)


David.