Some of the coolest features added to papervision 2 (great white) are those relating to lights and shading. The phongShader also allows you to apply bump maps to your models:
//create simple material
var ballMat:MovieAssetMaterial = new MovieAssetMaterial("tennisMat");
//create bump map material
var ballBumpMat:MovieAssetMaterial = new MovieAssetMaterial("tennisBump");
//create phong shader
var ballShader:PhongShader = new PhongShader(pointLight, 0x145A22, 0x4AD766, 20, ballBumpMat.bitmap,
ballMat.bitmap);
//combine the shader with the original material
var ballShadedMat:ShadedMaterial = new ShadedMaterial(ballMat, ballShader);
To create a tile material, you simply need to set the tiled property to true, and then set maxU and maxV properties to the number of tiles.eg.
var tiledMat:BitmapAssetMaterial = new BitmapAssetMaterial("AlgaeMetalPlate");
tiledMat.tiled = true;
tiledMat.maxU = 2;
tiledMat.maxV = 2;
A composite material allows you to layer multiple simple materials in a new “combined” material:
var wireMat:WireframeMaterial = new WireframeMaterial(0xCCCCFF); var colorMat:ColorMaterial = new ColorMaterial(0x00FFCC); var compMat:CompositeMaterial = new CompositeMaterial(); compMat.addMaterial(wireMat); compMat.addMaterial(colorMat);