Class KX_PolygonMaterial -- Blender Game Engine 2.49b



 
 



Notes


Note:
To access these functions, Texture Face Materials must be checked.

Note:
You also need PyOpenGL and GLEWPy to use this Class

PyOpenGL (used to bind OpenGL to the API)
 http://pyopengl.sourceforge.net/
GLEWPy (brings advanced OpenGL extensions to Python)
http://glewpy.sourceforge.net/

Link to the official Documentation

Note:
There's isn't any sample code.

activate

activate(rasty, cachingInfo)

From the official documentation:

Sets material parameters for this object for rendering.

Material Parameters set:
1. Texture
2. Backface Culling
3. Line drawing
4. Specular Colour
5. Shininess
6. Diffuse Color
7. Polygon Offset

rasty(CObject) Rasterizer instance

cachingInfo (CObject) Material cache instance

setCustomMaterial

setCustomMaterial(material)

From the official documentation:

Sets the material state setup object.

Using this method, you can extend of completely replace the game engine material to do your own advanced multipass effects.

material (instance)  The material object.

setTexture

setTexture(tface)

From the official documentation:

Sets texture render state

tface (CObject)  Texture face

updateTexture

updateTexture(tface, rasty)

From the official documentation:

Updates a realtime animation.

tface (CObject) Texture face (eg. mat.tface)
rasty (CObject) Rasterizer









Variables

From the official documentation:

diffuse
The diffuse color of the material

drawingmode
Drawing mode for the material

gl_texture
OpenGL texture handle

lightlayer
Light layers this material affects

material
Material name

shininess
The shininess (specular exponent) of the material

specular
The specular color of the material

specularity
The amount of specular of the material

texture
Texture name

tface
Texture face properties

tile
Texture is tiling

tilexrep
Number of tile repetitions in the x direction

tileyrep
Number of tile repetitions in the y direction

transparent
This material is transparent

triangle
Mesh data with this material is triangles

zsort
Transparent polygons in meshes with this material will be sorted back to front before rendering


Game developers can use the game engine to create casual video games, first and third person shooters, role playing games, racing simulations and more. The game engine can be used to make both 2D games and 3D games.  Beginning game developers will only need basic knowledge of game design and programming to create rich and complex game models with photo realistic textures to add detail to the graphics of the video game.  Today's games need more than good looking low polygon game models.  Use normal maps and photo realistic textures to create high quality game models.