Package | org.zozuar.volumetrics |
Class | public class VolumetricPointLight |
Inheritance | VolumetricPointLight ![]() ![]() |
This should also perform a little better than EffectContainer.
Property | Defined By | ||
---|---|---|---|
_alphas : Array | VolumetricPointLight | ||
![]() | _baseBmd : BitmapData | EffectContainer | |
![]() | _blurFilter : BlurFilter | EffectContainer | |
![]() | _bufferBmd : BitmapData | EffectContainer | |
![]() | _bufferRect : Rectangle | EffectContainer | |
![]() | _bufferSize : uint = 0x8000 | EffectContainer | |
_colors : Array | VolumetricPointLight | ||
![]() | _ct : ColorTransform | EffectContainer | |
![]() | _emission : DisplayObject | EffectContainer | |
_gradient : Shape | VolumetricPointLight | ||
_gradientBmp : Bitmap | VolumetricPointLight | ||
_gradientLoResBmd : BitmapData | VolumetricPointLight | ||
_gradientLoResDirty : Boolean = true | VolumetricPointLight | ||
_gradientMtx : Matrix | VolumetricPointLight | ||
![]() | _halve : ColorTransform | EffectContainer | |
_lastColorIntegrity : Boolean = false | VolumetricPointLight | ||
_lastIntensity : Number | VolumetricPointLight | ||
_lastSrcX : Number | VolumetricPointLight | ||
_lastSrcY : Number | VolumetricPointLight | ||
![]() | _lightBmp : Bitmap | EffectContainer | |
![]() | _mtx : Matrix | EffectContainer | |
![]() | _occlusion : DisplayObject | EffectContainer | |
![]() | _occlusionLoResBmd : BitmapData | EffectContainer | |
![]() | _occlusionLoResBmp : Bitmap | EffectContainer | |
_ratios : Array | VolumetricPointLight | ||
![]() | _viewportHeight : uint | EffectContainer | |
![]() | _viewportWidth : uint | EffectContainer | |
![]() | _zero : Point | EffectContainer |
Method | Defined By | ||
---|---|---|---|
VolumetricPointLight(width:uint, height:uint, occlusion:DisplayObject, colorOrGradient:*, alphas:Array = null, ratios:Array = null)
Creates a new effect container, with an emission created from the supplied color or gradient. | VolumetricPointLight | ||
dispose():void [override]
Dispose of all intermediate buffers. | VolumetricPointLight | ||
render(e:Event = null):void [override]
Render a single frame. | VolumetricPointLight | ||
![]() | setBufferSize(size:uint):void
Sets the approximate size (in pixels) of the effect's internal buffers. | EffectContainer | |
setViewportSize(width:uint, height:uint):void [override]
Sets the container's size. | VolumetricPointLight | ||
![]() | startRendering():void
Render the effect on every frame until stopRendering is called. | EffectContainer | |
![]() | stopRendering():void
Stop rendering on every frame. | EffectContainer |
Method | Defined By | ||
---|---|---|---|
![]() | _applyEffect(bmd:BitmapData, rect:Rectangle, buffer:BitmapData, mtx:Matrix, passes:uint):void
Low-level workhorse, applies the lighting effect to a bitmap. | EffectContainer | |
![]() | _copyMatrix(src:Matrix, dst:Matrix):void | EffectContainer | |
_drawGradient():void | VolumetricPointLight | ||
_drawLoResEmission():void [override]
Updates the lo-res gradient bitmap if neccesary and copies it to _baseBmd. | VolumetricPointLight | ||
![]() | _eraseLoResOcclusion():void
Draws a scaled-down occlusion on _occlusionLoResBmd and erases it from _baseBmd. | EffectContainer | |
_updateBuffers():void [override] | VolumetricPointLight |
_alphas | property |
protected var _alphas:Array
_colors | property |
protected var _colors:Array
_gradient | property |
protected var _gradient:Shape
_gradientBmp | property |
protected var _gradientBmp:Bitmap
_gradientLoResBmd | property |
protected var _gradientLoResBmd:BitmapData
_gradientLoResDirty | property |
protected var _gradientLoResDirty:Boolean = true
_gradientMtx | property |
protected var _gradientMtx:Matrix
_lastColorIntegrity | property |
protected var _lastColorIntegrity:Boolean = false
_lastIntensity | property |
protected var _lastIntensity:Number
_lastSrcX | property |
protected var _lastSrcX:Number
_lastSrcY | property |
protected var _lastSrcY:Number
_ratios | property |
protected var _ratios:Array
VolumetricPointLight | () | Constructor |
public function VolumetricPointLight(width:uint, height:uint, occlusion:DisplayObject, colorOrGradient:*, alphas:Array = null, ratios:Array = null)
Creates a new effect container, with an emission created from the supplied color or gradient. The constructor lets you use a shortcut syntax for creating simple single-color gradients.
Parameterswidth:uint — Viewport width in pixels.
| |
height:uint — Viewport height in pixels.
| |
occlusion:DisplayObject — An occlusion object, will be overlayed above the lighting gradient and under the light effect bitmap.
| |
colorOrGradient:* — Either a gradient colors array, or a uint color value.
| |
alphas:Array (default = null ) — Will only be used if colorOrGradient is an array. This will be passed to beginGradientFill.
If not provided alphas will all be 1.
| |
ratios:Array (default = null ) — Will only be used if colorOrGradient is an array. This will be passed to
beginGradientFill. If colorOrGradient is an Array and ratios aren't provided default
ones will be created automatically.
|
new VolumetricPointLight(800, 600, occlusion, 0xc08040);
new VolumetricPointLight(800, 600, occlusion, [0xc08040, 0], [1, 1], [0, 255]);
_drawGradient | () | method |
protected function _drawGradient():void
_drawLoResEmission | () | method |
override protected function _drawLoResEmission():void
Updates the lo-res gradient bitmap if neccesary and copies it to _baseBmd.
_updateBuffers | () | method |
override protected function _updateBuffers():void
dispose | () | method |
override public function dispose():void
Dispose of all intermediate buffers. After calling this the EffectContainer object will be unusable.
render | () | method |
override public function render(e:Event = null):void
Render a single frame.
Parameters
e:Event (default = null ) — In case you want to make this an event listener.
|
setViewportSize | () | method |
override public function setViewportSize(width:uint, height:uint):void
Sets the container's size. This method recreates internal buffers (slow), do not call this on every frame.
Parameters
width:uint — Viewport width in pixels
| |
height:uint — Viewport height in pixels
|