To use shaders in our project, the main script needs to be changed. Create a new Python script called ShaderTeapot. py. All of the following code will be new to this file, though I have presented the shader-specific code in bold for you to take extra note of as you type it out:
from Object import *
from pygame.locals import *
from Camera import *
from LoadMesh import *
from Material import *
from Settings import *
pygame.init ()
pygame.display.gl_set_attribute (
pygame.GL_MULTISAMPLEBUFFERS,1)
pygame.display.gl_set_attribute (
pygame.GL_MULTISAMPLESAMPLES, 4)
pygame.display.gl_set_attribute (
pygame.GL_CONTEXT_PROFILE_MASK,
pygame.GL_CONTEXT_PROFILE_CORE)
pygame.display.gl_set_attribute (pygame.GL_DEPTH_SIZE,
32)