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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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()
예제 #5
0
 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()
예제 #6
0
 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()