public void handleShading(int intensity, int falloff, int lightX,
			int lightY, int lightZ) {
		for (int triangle = 0; triangle < triangleCount; triangle++) {
			int x = triangleX[triangle];
			int y = triangleY[triangle];
			int z = triangleZ[triangle];
			if (triangleDrawType == null) {
				int colour = triangleColours[triangle];
				VertexNormal vertexNormal = super.vertexNormals[x];
				int lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLA[triangle] = mixLightness(colour, lightness, 0);
				vertexNormal = super.vertexNormals[y];
				lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLB[triangle] = mixLightness(colour, lightness, 0);
				vertexNormal = super.vertexNormals[z];
				lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLC[triangle] = mixLightness(colour, lightness, 0);
			} else if ((triangleDrawType[triangle] & 1) == 0) {
				int colour = triangleColours[triangle];
				int drawType = triangleDrawType[triangle];
				VertexNormal vertexNormal = super.vertexNormals[x];
				int lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLA[triangle] = mixLightness(colour, lightness,
						drawType);
				vertexNormal = super.vertexNormals[y];
				lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLB[triangle] = mixLightness(colour, lightness,
						drawType);
				vertexNormal = super.vertexNormals[z];
				lightness = intensity
						+ (lightX * vertexNormal.x + lightY * vertexNormal.y + lightZ
								* vertexNormal.z)
						/ (falloff * vertexNormal.magnitude);
				triangleHSLC[triangle] = mixLightness(colour, lightness,
						drawType);
			}
		}

		super.vertexNormals = null;
		vertexNormalOffset = null;
		vertexSkins = null;
		triangleSkins = null;
		if (triangleDrawType != null) {
			for (int triangle = 0; triangle < triangleCount; triangle++)
				if ((triangleDrawType[triangle] & 2) == 2)
					return;

		}
		triangleColours = null;
	}