MCPcopy Create free account
hub / github.com/Blakkis/PyGLMaze / renderQuad

Method renderQuad

pymaze/post_processing.py:152–177  ·  view source on GitHub ↗
(self, seconds, camera)

Source from the content-addressed store, hash-verified

150
151
152 def renderQuad(self, seconds, camera):
153 shader_type = PPostTypes.getCurrentShaderID()
154
155 shader = PWShaders.getShader(shader_type)
156 glUseProgram(shader.shader)
157
158 self.setExtraUniforms(shader, shader_type, seconds)
159
160 # Feed some funky stuff for the shaders
161 glUniform1f(shader.seconds, seconds)
162 glUniform2f(shader.resolution, self.d_resolution.x, self.d_resolution.y)
163
164 # --------
165
166 glDisable(GL_DEPTH_TEST)
167
168 glActiveTexture(GL_TEXTURE0)
169 glBindTexture(GL_TEXTURE_2D, self.color_texture)
170
171 glActiveTexture(GL_TEXTURE1)
172 glBindTexture(GL_TEXTURE_2D, self.depth_texture)
173
174 glBindVertexArray(self.quad.vao)
175 glDrawArrays(GL_TRIANGLES, 0, 6)
176
177 glEnable(GL_DEPTH_TEST)
178
179
180 # All post processing shaders share the same common uniforms

Callers 1

endMethod · 0.95

Calls 3

setExtraUniformsMethod · 0.95
getCurrentShaderIDMethod · 0.80
getShaderMethod · 0.80

Tested by

no test coverage detected