Now let's see how we can generate a normal map inside Away3D using the NormalMapGenerator
class located in the materials.utils
package.
Create a basic Away3D scene using AwayTemplate
. Then make sure you load or embed SimpleBitmap1.png
and HeightMap.png
image files, which are located in this chapter's assets folder.
NormalMapGen.as
package { public class NormalMapGen extends AwayTemplate { [Embed(source="assets/SimpleBitmap1.png")] private var SimpleTexture:Class; [Embed(source="assets/HeightMap.png")] private var HeightMap:Class; private var _normalMap:BitmapData; private var _normThumb:Bitmap; private var _pointLight:PointLight3D; private var _sp:Sphere; private ...
No credit card required