22
33import moderngl
44from demosys import geometry
5- from demosys .opengl import texture
5+ from demosys .opengl . texture import helper
66from demosys .effects import Effect
77
88
@@ -68,10 +68,10 @@ def draw_buffers(self, near, far):
6868 """
6969 self .ctx .disable (moderngl .DEPTH_TEST )
7070
71- texture .draw (self .gbuffer .color_attachments [0 ], pos = (0.0 , 0.0 ), scale = (0.25 , 0.25 ))
72- texture .draw (self .gbuffer .color_attachments [1 ], pos = (0.5 , 0.0 ), scale = (0.25 , 0.25 ))
73- texture .draw_depth (self .gbuffer .depth_attachment , near , far , pos = (1.0 , 0.0 ), scale = (0.25 , 0.25 ))
74- texture .draw (self .lightbuffer .color_attachments [0 ], pos = (1.5 , 0.0 ), scale = (0.25 , 0.25 ))
71+ helper .draw (self .gbuffer .color_attachments [0 ], pos = (0.0 , 0.0 ), scale = (0.25 , 0.25 ))
72+ helper .draw (self .gbuffer .color_attachments [1 ], pos = (0.5 , 0.0 ), scale = (0.25 , 0.25 ))
73+ helper .draw_depth (self .gbuffer .depth_attachment , near , far , pos = (1.0 , 0.0 ), scale = (0.25 , 0.25 ))
74+ helper .draw (self .lightbuffer .color_attachments [0 ], pos = (1.5 , 0.0 ), scale = (0.25 , 0.25 ))
7575
7676 def add_point_light (self , position , radius ):
7777 """Add point light"""
@@ -83,7 +83,7 @@ def render_lights(self, camera_matrix, projection):
8383 self .ctx .front_face = 'cw'
8484 self .ctx .blend_func = moderngl .ONE , moderngl .ONE
8585
86- texture ._depth_sampler .use (location = 1 )
86+ helper ._depth_sampler .use (location = 1 )
8787 with self .lightbuffer_scope :
8888 for light in self .point_lights :
8989 # Calc light properties
@@ -101,7 +101,7 @@ def render_lights(self, camera_matrix, projection):
101101 self .point_light_shader ["radius" ].value = light_size
102102 self .unit_cube .render (self .point_light_shader )
103103
104- texture ._depth_sampler .clear (location = 1 )
104+ helper ._depth_sampler .clear (location = 1 )
105105
106106 def render_lights_debug (self , camera_matrix , projection ):
107107 """Render outlines of light volumes"""
0 commit comments