(self, camera: Camera)
| 1043 | # The actual rendering function |
| 1044 | @torch.no_grad() |
| 1045 | def render(self, camera: Camera): |
| 1046 | # Perform actual gaussian rendering |
| 1047 | batch = add_batch(to_cuda(camera.to_batch())) |
| 1048 | sh0 = rgb2sh0(self.rgb[..., None]) |
| 1049 | xyz = self.pts |
| 1050 | occ = (self.occ * self.alpha_mult).clip(0, 1) |
| 1051 | rad = self.rad * self.radius_mult |
| 1052 | |
| 1053 | rgb, acc, dpt = self.render_radius(*add_batch([xyz, sh0, rad, occ]), batch) |
| 1054 | rgb, acc, dpt = rgb[0], acc[0], dpt[0] |
| 1055 | |
| 1056 | if self.view_depth: |
| 1057 | rgba = torch.cat([depth_curve_fn(dpt, cm=self.dpt_cm), acc], dim=-1) # H, W, 4 |
| 1058 | else: |
| 1059 | rgba = torch.cat([rgb, acc], dim=-1) # H, W, 4 |
| 1060 | |
| 1061 | # Copy rendered tensor to screen |
| 1062 | rgba = (rgba.clip(0, 1) * 255).type(torch.uint8).flip(0) # transform |
| 1063 | self.quad.copy_to_texture(rgba) |
| 1064 | self.quad.render() |
| 1065 | |
| 1066 | def render_imgui(mesh, viewer: 'VolumetricVideoViewer', batch: dotdict): |
| 1067 | super().render_imgui(viewer, batch) |
nothing calls this directly
no test coverage detected