Packagede.popforge.imageprocessing.filters.distortion
Classpublic final class QuickBumpMap
InheritanceQuickBumpMap Inheritance DisplacementMap Inheritance NativeFilter

The QuickBumpMap class is a filter that uses a normal and light map to create a three-dimensional effect on textures. Therefore the given image to this filter will be used as a texture. The parameters are the bump map and the light map. The bump map has to be converted into a normal map. You can do this before or let the filter do this automatically for you. Instead of a pixel-by-pixel basis this filter uses the native DisplacementMapFilter to work also very fast on run time. It is very hard to compete with this filter because it achieves a real bump mapping effect and has a very short execution time.

This approach comes from Ralph Hauwert.

Supported formats:


Example
  
  var filter: QuickBumpMap = new QuickBumpMap( bumpMap, lightMap, 80, 60 );
  
  var lightMap: Image = Image.fromBitmapData( lightMap_, ImageFormat.RGB );
  var bumpMap: Image = Image.fromBitmapData( bumpMap_, ImageFormat.RGB );
  var image: Image = Image.fromBitmapData( textureMap, ImageFormat.RGB );
  
  filter.apply( image );
  

See also

Ralph Hauwert´s blog
de.popforge.imageprocessing.filters.distortion.QuickNormalMap


Public Properties
 PropertyDefined by
  lightX : Number
The x position of the light map.
QuickBumpMap
  lightY : Number
The y position of the light map.
QuickBumpMap
Protected Properties
 PropertyDefined by
 Inheritedfilter : BitmapFilter
The native filter that will be overridden by a subclass of NativeFilter.
NativeFilter
Public Methods
 MethodDefined by
  
QuickBumpMap(bumpMap:Image, lightMap:Image, lightX:Number = 10, lightY:Number = 10, lightColor:int = 0xffffff, convertToNormalMap:Boolean = true)
Creates a new QuickBumpMap object.
QuickBumpMap
  
apply(image:Image):void
Applies the filter to the given Image object.
QuickBumpMap
  
toString():String
Builds and returns a string containing the name of the class.
QuickBumpMap
Property detail
lightXproperty
lightX:Number  [read-write]

The x position of the light map.

Implementation
    public function get lightX():Number
    public function set lightX(value:Number):void
lightYproperty 
lightY:Number  [read-write]

The y position of the light map.

Implementation
    public function get lightY():Number
    public function set lightY(value:Number):void
Constructor detail
QuickBumpMap()constructor
public function QuickBumpMap(bumpMap:Image, lightMap:Image, lightX:Number = 10, lightY:Number = 10, lightColor:int = 0xffffff, convertToNormalMap:Boolean = true)

Creates a new QuickBumpMap object.

Parameters
bumpMap:Image — The bump map that should be applied to the image.
 
lightMap:Image — The light map that should be applied to the image.
 
lightX:Number (default = 10) — The x position of the light map.
 
lightY:Number (default = 10) — The y position of the light map.
 
lightColor:int (default = 0xffffff) — The color multiplier for the light map (0xffffff would not change anything of the color).
 
convertToNormalMap:Boolean (default = true) — Set this to false if you already converted your bump map into a normal map.
Method detail
apply()method
public override function apply(image:Image):void

Applies the filter to the given Image object.

Parameters
image:Image — The image that will be manipulated.
toString()method 
public override function toString():String

Builds and returns a string containing the name of the class.

Returns
String — A string containing the name of the class.