Exemple #1
0
 def setupShaders(self):
     self.programA = gl.glCreateProgram()
     gl.glAttachShader(
         self.programA,
         pyglet_helper.compile_shader(gl.GL_VERTEX_SHADER,
                                      self.vertex_source))
     if args["operation"] == "similar":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(gl.GL_FRAGMENT_SHADER,
                                          self.fragment_source_a))
     elif args["operation"] == "intersect":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(
                 gl.GL_FRAGMENT_SHADER,
                 self.fragment_source_intersection))
     elif args["operation"] == "union":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(gl.GL_FRAGMENT_SHADER,
                                          self.fragment_source_union))
     elif args["operation"] == "difference":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(
                 gl.GL_FRAGMENT_SHADER,
                 self.fragment_source_difference))
     else:
         print("not a valid operation")
     pyglet_helper.link_program(self.programA)
Exemple #2
0
        def setupShaders(self):
            self.programA = gl.glCreateProgram()
            gl.glAttachShader(
                self.programA,
                pyglet_helper.compile_shader(gl.GL_VERTEX_SHADER,
                                             self.vertex_source))

            gl.glAttachShader(
                self.programA,
                pyglet_helper.compile_shader(gl.GL_FRAGMENT_SHADER,
                                             self.fragment_source_a))
            pyglet_helper.link_program(self.programA)
 def setupShaders(self):
     self.programA = gl.glCreateProgram()
     gl.glAttachShader(
         self.programA,
         pyglet_helper.compile_shader(gl.GL_VERTEX_SHADER,
                                      self.vertex_source))
     if args["shape"] == "sphere":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(gl.GL_FRAGMENT_SHADER,
                                          self.fragment_source_a))
     elif args["shape"] == "cylinder":
         gl.glAttachShader(
             self.programA,
             pyglet_helper.compile_shader(
                 gl.GL_FRAGMENT_SHADER, self.fragment_source_cylinder))
     pyglet_helper.link_program(self.programA)