|
setUniform2isetUniform2i(name, ix, iy)Used to pass two integer values from the main program to the vertex or fragment program.name: Type:
string
ix:Type:
integer
iy:Type:
integer
Sample Code# define the main part of the programdef main():# get the current scenescene = GameLogic.getCurrentScene()# get a list of the objects in the sceneobjList = scene.objects# Get the object you want to useobj = objList['OBCube']# Only one mesh on this Cubemesh = obj.meshes[0]# only one material on this meshmat = mesh.materials[0]# Using Blender GLSL Materials or Blender Multitexture Materials?if hasattr( mat, 'getMaterialIndex') == True:#Get shader envelopeshader = mat.getShader()# shader envelope created?if shader != None:# set the shadershader.setSource(VertexShader, FragmentShader, True)# pass ivec2 variable to shadershader.setUniform2i("MinMax", 0, 10)####### end of main program def# Import OpenGL code as a stringVertexProgram = """ |