def render_shadow(self, renderable: Renderable): self._init() self._rendering_depth_map = True with gl.render_to_texture(self._framebuffer, depth=self._depth_buffer, viewport_size=self._depth_map_wh): gl.clear_viewport() renderable.render(self) gl.glFinish() self._rendering_depth_map = False
def _render(self, scene: Scene, camera: Camera, viewport_size_wh): if scene.projector is not None: scene.projector.render_shadow(scene) with gl.render_to_texture(self._framebuffer, color=self._color_buffer, depth=self._depth_buffer, viewport_size=viewport_size_wh): gl.clear_viewport() scene.render(camera) gl.glFinish() depth = gl.read_depth(self._depth_buffer, viewport_size_wh) color = gl.read_color(self._color_buffer, viewport_size_wh) return color, depth
def _render(scene: Scene, camera: Camera): if scene.projector is not None: scene.projector.render_shadow(scene) gl.clear_viewport() scene.render(camera) gl.glFinish()
def _render(self, scene: Scene, camera: Camera): if scene.projector is not None: scene.projector.render_shadow(scene) gl.clear_viewport(self._background_colour) scene.render(camera) gl.glFinish()