Package | away3d.materials.utils |
Class | public class NormalMapGenerator |
Inheritance | NormalMapGenerator ![]() |
Property | Defined by | ||
---|---|---|---|
blur : int [write-only]
| NormalMapGenerator | ||
bumpmap : BitmapData [read-only]
Returns the generated bump source for a displacementfilter generated by the class
| NormalMapGenerator | ||
bumpsource : BitmapData [write-only]
An optional bump information can be burned into the normalmap
| NormalMapGenerator | ||
growpixels : Boolean [write-only]
| NormalMapGenerator | ||
height : int [write-only]
| NormalMapGenerator | ||
maxfaces : int [write-only]
| NormalMapGenerator | ||
mesh : Mesh
[write-only]
The mesh Object3D to be traced.
| NormalMapGenerator | ||
normalmap : BitmapData [read-only]
Returns the normalMap generated by the class
| NormalMapGenerator | ||
type : String [write-only]
| NormalMapGenerator | ||
width : int [write-only]
| NormalMapGenerator |
Method | Defined by | ||
---|---|---|---|
NormalMapGenerator
(mesh:Mesh = null, width:int = 512, height:int = 512, bumpsource:BitmapData = null, blur:int = 0, growpixels:Boolean = false, maxfaces:int = 50, type:String = "objectspace")
Class NormalMapGenerator generates a normalmap from a given Mesh object and merge an additionl bump information to it.
| NormalMapGenerator | ||
addOnTraceComplete(listener:Function):void
Default method for adding a tracecomplete event listener
| NormalMapGenerator | ||
addOnTraceProgress(listener:Function):void
Default method for adding a traceprogress event listener
| NormalMapGenerator | ||
apply():void
Starts the rendering of the normal map if a mesh object has been defined
| NormalMapGenerator | ||
applyBump(bm:BitmapData, nm:BitmapData):BitmapData
Applys a bump to a given normal map.
| NormalMapGenerator | ||
cancel():void
Cancels the trace
| NormalMapGenerator | ||
removeOnTraceComplete(listener:Function):void
Default method for removing a tracecomplete event listener
| NormalMapGenerator | ||
removeOnTraceProgress(listener:Function):void
Default method for removing a traceprogress event listener
| NormalMapGenerator |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched while the class is busy tracing. | NormalMapGenerator | |||
Dispatched full trace is done. | NormalMapGenerator |
blur | property |
blur:int
[write-only]Implementation
public function set blur(value:int):void
bumpmap | property |
bumpmap:BitmapData
[read-only]Returns the generated bump source for a displacementfilter generated by the class
Implementation public function get bumpmap():BitmapData
bumpsource | property |
bumpsource:BitmapData
[write-only]An optional bump information can be burned into the normalmap
Implementation public function set bumpsource(value:BitmapData):void
growpixels | property |
growpixels:Boolean
[write-only]Implementation
public function set growpixels(value:Boolean):void
height | property |
height:int
[write-only]Implementation
public function set height(value:int):void
maxfaces | property |
maxfaces:int
[write-only]Implementation
public function set maxfaces(value:int):void
mesh | property |
mesh:Mesh
[write-only]The mesh Object3D to be traced.
Implementation public function set mesh(value:Mesh):void
normalmap | property |
normalmap:BitmapData
[read-only]Returns the normalMap generated by the class
Implementation public function get normalmap():BitmapData
type | property |
type:String
[write-only]Implementation
public function set type(value:String):void
width | property |
width:int
[write-only]Implementation
public function set width(value:int):void
NormalMapGenerator | () | constructor |
public function NormalMapGenerator(mesh:Mesh = null, width:int = 512, height:int = 512, bumpsource:BitmapData = null, blur:int = 0, growpixels:Boolean = false, maxfaces:int = 50, type:String = "objectspace")
Parameters
mesh:Mesh (default = null ) — [optional] Mesh. The Mesh object to be traced.
|
|
width:int (default = 512 ) — [optional] int. The width of the generated normalmap. Default is 512.
|
|
height:int (default = 512 ) — [optional] int. The height of the generated normalmap. Default is 512.
|
|
bumpsource:BitmapData (default = null ) — [optional] BitmapData. The source bitmapdata for an additional bump information. Default is null;
|
|
blur:int (default = 0 ) — [optional] int. Blur value if applyed, the surface of the object becomes smoother. Default is 0;
|
|
growpixels:Boolean (default = false ) — [optional] Boolean. To avoid some artefacts cause by the pixel trace. adds pixels at the edges of the trace.
|
|
maxfaces:int (default = 50 ) — [optional] int. To avoid that the player generates a timeout error, the class handles the trace of faces stepwize. Default is 50 faces.
|
|
type:String (default = "objectspace ") — [optional] String. If the map is of type objectspace or tangent. Default = objectspace;
It is a good practice to render the map with great size and eventually reduce after its rendered, since Flash doesn't allow to draw smaller than a pixel while the uv information might ask a smaller draw.
The mesh MUST have a unique mapping. Any overlapping face area will result in artefacts.
|
addOnTraceComplete | () | method |
public function addOnTraceComplete(listener:Function):void
Default method for adding a tracecomplete event listener
Parameterslistener:Function — The listener function
|
addOnTraceProgress | () | method |
public function addOnTraceProgress(listener:Function):void
Default method for adding a traceprogress event listener
Parameterslistener:Function — The listener function
|
apply | () | method |
public function apply():void
Starts the rendering of the normal map if a mesh object has been defined
applyBump | () | method |
public function applyBump(bm:BitmapData, nm:BitmapData):BitmapData
Applys a bump to a given normal map. If you do not generate the map from a mesh, just pass null in the constructor.
Parametersbm:BitmapData — BitmapData. The source bumpmap.
|
|
nm:BitmapData — BitmapData. The source normalmap.
return BitmapData. The source normalmap with the bump applied to it
|
BitmapData |
cancel | () | method |
public function cancel():void
Cancels the trace
removeOnTraceComplete | () | method |
public function removeOnTraceComplete(listener:Function):void
Default method for removing a tracecomplete event listener
Parameterslistener:Function — The listener function
|
removeOnTraceProgress | () | method |
public function removeOnTraceProgress(listener:Function):void
Default method for removing a traceprogress event listener
Parameterslistener:Function — The listener function
|
tracecomplete | event |
away3d.events.TraceEvent
Dispatched while the class is busy tracing. Note that the source can already be used for a Material
traceprogress | event |