|
1 | 1 | import moderngl |
2 | 2 | from demosys import context, geometry, resources |
3 | | -from demosys.opengl import FBO, DepthTexture, Texture2D, samplers |
| 3 | +from demosys.opengl import FBO, DepthTexture, Texture2D |
4 | 4 | from pyrr import matrix44 |
5 | 5 |
|
6 | 6 |
|
@@ -30,10 +30,6 @@ def __init__(self, width, height, gbuffer=None, lightbuffer=None): |
30 | 30 | self.width = width |
31 | 31 | self.height = height |
32 | 32 | self.size = (width, height) |
33 | | - self.depth_sampler = samplers.create( |
34 | | - texture_compare_mode=False, |
35 | | - min_filter=moderngl.LINEAR, mag_filter=moderngl.LINEAR |
36 | | - ) |
37 | 33 |
|
38 | 34 | # FBOs |
39 | 35 | self.gbuffer = gbuffer |
@@ -113,16 +109,13 @@ def render_lights(self, camera_matrix, projection): |
113 | 109 | self.point_light_shader.uniform("m_light", m_light.astype('f4').tobytes()) |
114 | 110 | self.gbuffer.color_buffers[1].use(location=0) |
115 | 111 | self.point_light_shader.uniform("g_normal", 0) |
116 | | - self.depth_sampler.use(location=1) |
117 | 112 | self.gbuffer.depth_buffer.use(location=1) |
118 | 113 | self.point_light_shader.uniform("g_depth", 1) |
119 | 114 | self.point_light_shader.uniform("screensize", (self.width, self.height)) |
120 | 115 | self.point_light_shader.uniform("proj_const", projection.projection_constants) |
121 | 116 | self.point_light_shader.uniform("radius", light_size) |
122 | 117 | self.unit_cube.draw(self.point_light_shader) |
123 | 118 |
|
124 | | - self.depth_sampler.release() |
125 | | - |
126 | 119 | self.ctx.disable(moderngl.BLEND) |
127 | 120 | self.ctx.disable(moderngl.CULL_FACE) |
128 | 121 |
|
|
0 commit comments