@@ -91,26 +91,25 @@ def _may_interrupt_trace(self, frame, event, arg):
9191 def _get_img_wh (self , aspect : float ) -> Tuple [int , int ]:
9292 # we always trade off speed for quality
9393 max_img_res = self .viewer .render_tab_state .viewer_res
94- if self ._state in ["high" ]:
95- # if True:
96- H = max_img_res
97- W = int (H * aspect )
98- if W > max_img_res :
99- W = max_img_res
100- H = int (W / aspect )
101- elif self ._state in ["low_move" , "low_static" ]:
102- num_view_rays_per_sec = self .viewer .render_tab_state .num_view_rays_per_sec
103- target_fps = self ._target_fps
104- num_viewer_rays = num_view_rays_per_sec / target_fps
105- H = (num_viewer_rays / aspect ) ** 0.5
106- H = int (round (H , - 1 ))
107- H = max (min (max_img_res , H ), 30 )
108- W = int (H * aspect )
109- if W > max_img_res :
110- W = max_img_res
111- H = int (W / aspect )
112- else :
113- raise ValueError (f"Unknown state: { self ._state } ." )
94+ # if self._state in ["high"]:
95+ H = max_img_res
96+ W = int (H * aspect )
97+ if W > max_img_res :
98+ W = max_img_res
99+ H = int (W / aspect )
100+ # elif self._state in ["low_move", "low_static"]:
101+ # num_view_rays_per_sec = self.viewer.render_tab_state.num_view_rays_per_sec
102+ # target_fps = self._target_fps
103+ # num_viewer_rays = num_view_rays_per_sec / target_fps
104+ # H = (num_viewer_rays / aspect) ** 0.5
105+ # H = int(round(H, -1))
106+ # H = max(min(max_img_res, H), 30)
107+ # W = int(H * aspect)
108+ # if W > max_img_res:
109+ # W = max_img_res
110+ # H = int(W / aspect)
111+ # else:
112+ # raise ValueError(f"Unknown state: {self._state}.")
114113 return W , H
115114
116115 def submit (self , task : RenderTask ):
@@ -173,6 +172,7 @@ def run(self):
173172 self .viewer .render_tab_state .num_view_rays_per_sec = (W * H ) / (
174173 time .perf_counter () - tic
175174 )
175+ # print("FPS:", 1 / (time.perf_counter() - tic))
176176 except InterruptRenderException :
177177 continue
178178 except Exception :
0 commit comments