@@ -731,7 +731,6 @@ std::vector<vec3> Testbed::crop_box_corners(bool nerf_space) const {
731
731
tlog::info () << a.x << " ," << a.y << " ," << a.z << " [" << i << " ]" ;
732
732
}
733
733
}
734
-
735
734
return rv;
736
735
}
737
736
@@ -1124,6 +1123,7 @@ void Testbed::imgui() {
1124
1123
ImGui::SameLine ();
1125
1124
ImGui::Checkbox (" per-image latents" , &m_nerf.training .optimize_extra_dims );
1126
1125
1126
+
1127
1127
static bool export_extrinsics_in_quat_format = true ;
1128
1128
static bool extrinsics_have_been_optimized = false ;
1129
1129
@@ -1547,7 +1547,22 @@ void Testbed::imgui() {
1547
1547
}
1548
1548
1549
1549
if (m_testbed_mode == ETestbedMode::Nerf && ImGui::TreeNode (" NeRF rendering options" )) {
1550
+ if (!jit_fusion ()) {
1551
+ ImGui::BeginDisabled ();
1552
+ if (m_nerf.surface_rendering ) {
1553
+ tlog::warning () << " JIT fusion is disabled, disabling surface rendering." ;
1554
+ }
1555
+
1556
+ m_nerf.surface_rendering = false ;
1557
+ }
1558
+
1550
1559
ImGui::Checkbox (" Surface rendering" , &m_nerf.surface_rendering );
1560
+ if (!jit_fusion ()) {
1561
+ ImGui::SameLine ();
1562
+ ImGui::Text (" (requires JIT fusion)" );
1563
+ ImGui::EndDisabled ();
1564
+ }
1565
+
1551
1566
if (!m_nerf.surface_rendering ) {
1552
1567
ImGui::BeginDisabled ();
1553
1568
}
@@ -2117,24 +2132,26 @@ void Testbed::draw_visualizations(ImDrawList* list, const mat4x3& camera_matrix)
2117
2132
2118
2133
float xyscale = (float )m_window_res[m_fov_axis];
2119
2134
vec2 screen_center = render_screen_center (m_screen_center);
2120
- mat4 view2proj = transpose (mat4{
2121
- xyscale,
2122
- 0 .0f ,
2123
- (float )m_window_res.x * screen_center.x * zscale,
2124
- 0 .0f ,
2125
- 0 .0f ,
2126
- xyscale,
2127
- (float )m_window_res.y * screen_center.y * zscale,
2128
- 0 .0f ,
2129
- 0 .0f ,
2130
- 0 .0f ,
2131
- 1 .0f ,
2132
- 0 .0f ,
2133
- 0 .0f ,
2134
- 0 .0f ,
2135
- zscale,
2136
- 0 .0f ,
2137
- });
2135
+ mat4 view2proj = transpose (
2136
+ mat4{
2137
+ xyscale,
2138
+ 0 .0f ,
2139
+ (float )m_window_res.x * screen_center.x * zscale,
2140
+ 0 .0f ,
2141
+ 0 .0f ,
2142
+ xyscale,
2143
+ (float )m_window_res.y * screen_center.y * zscale,
2144
+ 0 .0f ,
2145
+ 0 .0f ,
2146
+ 0 .0f ,
2147
+ 1 .0f ,
2148
+ 0 .0f ,
2149
+ 0 .0f ,
2150
+ 0 .0f ,
2151
+ zscale,
2152
+ 0 .0f ,
2153
+ }
2154
+ );
2138
2155
2139
2156
mat4 world2proj = view2proj * world2view;
2140
2157
float aspect = (float )m_window_res.x / (float )m_window_res.y ;
@@ -2161,24 +2178,26 @@ void Testbed::draw_visualizations(ImDrawList* list, const mat4x3& camera_matrix)
2161
2178
float fly = focal.y ;
2162
2179
float zfar = m_ndc_zfar;
2163
2180
float znear = m_ndc_znear;
2164
- mat4 view2proj_guizmo = transpose (mat4{
2165
- fly * 2 .0f / aspect,
2166
- 0 .0f ,
2167
- 0 .0f ,
2168
- 0 .0f ,
2169
- 0 .0f ,
2170
- -fly * 2 .f ,
2171
- 0 .0f ,
2172
- 0 .0f ,
2173
- 0 .0f ,
2174
- 0 .0f ,
2175
- (zfar + znear) / (zfar - znear),
2176
- -(2 .0f * zfar * znear) / (zfar - znear),
2177
- 0 .0f ,
2178
- 0 .0f ,
2179
- 1 .0f ,
2180
- 0 .0f ,
2181
- });
2181
+ mat4 view2proj_guizmo = transpose (
2182
+ mat4{
2183
+ fly * 2 .0f / aspect,
2184
+ 0 .0f ,
2185
+ 0 .0f ,
2186
+ 0 .0f ,
2187
+ 0 .0f ,
2188
+ -fly * 2 .f ,
2189
+ 0 .0f ,
2190
+ 0 .0f ,
2191
+ 0 .0f ,
2192
+ 0 .0f ,
2193
+ (zfar + znear) / (zfar - znear),
2194
+ -(2 .0f * zfar * znear) / (zfar - znear),
2195
+ 0 .0f ,
2196
+ 0 .0f ,
2197
+ 1 .0f ,
2198
+ 0 .0f ,
2199
+ }
2200
+ );
2182
2201
2183
2202
ImGuizmo::SetRect (0 , 0 , io.DisplaySize .x , io.DisplaySize .y );
2184
2203
@@ -4260,16 +4279,18 @@ void Testbed::reset_network(bool clear_density_grid) {
4260
4279
4261
4280
// Instantiate an additional model for each auxiliary GPU
4262
4281
for (auto & device : m_devices) {
4263
- device.set_nerf_network (std::make_shared<NerfNetwork<network_precision_t >>(
4264
- dims.n_pos ,
4265
- n_dir_dims,
4266
- n_extra_dims,
4267
- dims.n_pos + 1 , // The offset of 1 comes from the dt member variable of NerfCoordinate. HACKY
4268
- encoding_config,
4269
- dir_encoding_config,
4270
- network_config,
4271
- rgb_network_config
4272
- ));
4282
+ device.set_nerf_network (
4283
+ std::make_shared<NerfNetwork<network_precision_t >>(
4284
+ dims.n_pos ,
4285
+ n_dir_dims,
4286
+ n_extra_dims,
4287
+ dims.n_pos + 1 , // The offset of 1 comes from the dt member variable of NerfCoordinate. HACKY
4288
+ encoding_config,
4289
+ dir_encoding_config,
4290
+ network_config,
4291
+ rgb_network_config
4292
+ )
4293
+ );
4273
4294
}
4274
4295
4275
4296
m_network = m_nerf_network = primary_device ().nerf_network ();
0 commit comments