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

Method setExtraUniforms

pymaze/post_processing.py:134–148  ·  view source on GitHub ↗
(self, shader, shader_type, seconds)

Source from the content-addressed store, hash-verified

132
133
134 def setExtraUniforms(self, shader, shader_type, seconds):
135 if shader_type == PPostTypes.PPOST_THIRD3D:
136 proj = glm.perspective(glm.radians(self.c_fov), self.c_aspect, self.c_near, self.c_far)
137 view = glm.lookAt(glm.vec3(0.0, 0.0, 1.0), glm.vec3(0.0), glm.vec3(0.0, 1.0, 0.0))
138
139 proj_view = np.array(proj * view, dtype='float32')
140 glUniformMatrix4fv(shader.proj_view, 1, GL_FALSE, proj_view)
141
142 model = glm.mat4(1.0)
143 model = glm.translate(model, glm.vec3(0.0, 0.0, -3.0))
144 model = glm.rotate(model, glm.radians(60.0), glm.vec3(0.0, 1.0, 0.0))
145
146 glUniformMatrix4fv(shader.model, 1, GL_FALSE, np.array(model, dtype='float32'))
147
148 # Add more if/elifs if needed
149
150
151

Callers 1

renderQuadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected