Packageaway3d.materials
Classpublic class GlassMaterial
InheritanceGlassMaterial Inheritance away3d.materials.SinglePassShaderMaterial

BitmapData material which creates reflections based on a cube map. The reflection strength changes based on the refraction of the material and its environment, as well as the angle of view. This can be used to create water-like reflections.



Public Properties
 PropertyDefined By
  dispersionB : Number
The scale of dispersion for the blue channel.
GlassMaterial
  dispersionG : Number
The scale of dispersion for the green channel.
GlassMaterial
  dispersionR : Number
The scale of dispersion for the red channel.
GlassMaterial
  envMapAlpha : Number
The opacity of the environment map, ie: how reflective the surface is.
GlassMaterial
  exponent : Number
The exponent of the calculated fresnel term.
GlassMaterial
  glassColor : uint
GlassMaterial
  innerRefraction : Number
The refractive index of the inner medium (ie the material itself)
GlassMaterial
  outerRefraction : Number
The refractive index of the outer medium (where the view ray starts)
GlassMaterial
Public Methods
 MethodDefined By
  
GlassMaterial(normalMap:BitmapData, envMap:BitmapData, targetModel:Mesh, chromaticDispersion:Boolean = false, init:Object = null)
Creates a new GlassMaterial object.
GlassMaterial
Protected Methods
 MethodDefined By
  
updatePixelShader(source:Object3D, view:View3D):void
[override]
GlassMaterial
Property Detail
dispersionBproperty
dispersionB:Number

The scale of dispersion for the blue channel. For best results, use value close to but lower than 1.


Implementation
    public function get dispersionB():Number
    public function set dispersionB(value:Number):void
dispersionGproperty 
dispersionG:Number

The scale of dispersion for the green channel. For best results, use value close to but lower than 1.


Implementation
    public function get dispersionG():Number
    public function set dispersionG(value:Number):void
dispersionRproperty 
dispersionR:Number

The scale of dispersion for the red channel. For best results, use value close to but lower than 1.


Implementation
    public function get dispersionR():Number
    public function set dispersionR(value:Number):void
envMapAlphaproperty 
envMapAlpha:Number

The opacity of the environment map, ie: how reflective the surface is. 1 is a perfect mirror.


Implementation
    public function get envMapAlpha():Number
    public function set envMapAlpha(value:Number):void
exponentproperty 
exponent:Number

The exponent of the calculated fresnel term. Lower values will only show reflections at steeper view angles.


Implementation
    public function get exponent():Number
    public function set exponent(value:Number):void
glassColorproperty 
glassColor:uint


Implementation
    public function get glassColor():uint
    public function set glassColor(value:uint):void
innerRefractionproperty 
innerRefraction:Number

The refractive index of the inner medium (ie the material itself)


Implementation
    public function get innerRefraction():Number
    public function set innerRefraction(value:Number):void
outerRefractionproperty 
outerRefraction:Number

The refractive index of the outer medium (where the view ray starts)


Implementation
    public function get outerRefraction():Number
    public function set outerRefraction(value:Number):void
Constructor Detail
GlassMaterial()Constructor
public function GlassMaterial(normalMap:BitmapData, envMap:BitmapData, targetModel:Mesh, chromaticDispersion:Boolean = false, init:Object = null)

Creates a new GlassMaterial object.

Parameters
normalMap:BitmapData — An object-space normal map
 
envMap:BitmapData — The spherical environment map used for reflections
 
targetModel:Mesh — The target mesh for which this shader is applied
 
chromaticDispersion:Boolean (default = false) — An initialisation object
 
init:Object (default = null)
####INIT####
Method Detail
updatePixelShader()method
override protected function updatePixelShader(source:Object3D, view:View3D):void

Parameters

source:Object3D
 
view:View3D