UnityMol  0.9.6-875
UnityMol viewer / In developement
AmbientOcclusion Class Reference
+ Collaboration diagram for AmbientOcclusion:

Public Member Functions

 AmbientOcclusion ()
 
void Occlude ()
 
void Revert ()
 

Static Public Attributes

static bool isEnabled = false
 
static bool reset = false
 

Static Private Member Functions

static float AverageOfSurroundingCubes (int i, int j, int k)
 
static float WeightedAverageOfSurroundingCubes (int i, int j, int k)
 
static void BuildColorList ()
 
static void FillFacesWithZeros ()
 
static void SetOcclusionGridBounds ()
 

Private Attributes

const float faceCoef = 1f
 
const float diagCoef = 0.707106781186548f
 
const float cornerCoef = 0.25f
 
const float totalWeightFactor = 1f/(6f*faceCoef + 12f*diagCoef + 8f*cornerCoef)
 

Static Private Attributes

static GameObject pdb2den
 
static PDBtoDEN genDensity
 
static float[,,] density
 
static float[,,] occlusion
 
static BallUpdate[] balls
 
static Vector3 delta
 
static Vector3 origin = MoleculeModel.MinValue
 
static Vector3 fudgeFactor
 
static Vector3 inverseDelta
 
static int xDim
 
static int yDim
 
static int zDim
 
static List< Color > originalColors
 
static float minDensity = float.MaxValue
 
static float maxDensity = -float.MaxValue
 
static bool weighted = true
 
static float compensationFactor = 1.30f
 

Detailed Description

Definition at line 66 of file AmbientOcclusion.cs.

Constructor & Destructor Documentation

Member Function Documentation

static float AmbientOcclusion.AverageOfSurroundingCubes ( int  i,
int  j,
int  k 
)
staticprivate

Computes the sum of the surrounding cubes.

That is the eight cubes around the cube of interest at the same Z coordinate, the 9 cubes right below (z-1) and the 9 cubes right above (z+1).

Returns
The of surrounding cubes.
Parameters
iX coordinate of the cube
jY coordinate of the cube
kZ coordinate of the cube

Definition at line 113 of file AmbientOcclusion.cs.

Referenced by AmbientOcclusion().

+ Here is the caller graph for this function:

static void AmbientOcclusion.BuildColorList ( )
staticprivate

Builds the list of the original colors, that is before the Depth Cueing effect is applied.

Definition at line 159 of file AmbientOcclusion.cs.

References Molecule.Model.MoleculeModel.atomsColorList.

Referenced by AmbientOcclusion().

+ Here is the caller graph for this function:

static void AmbientOcclusion.FillFacesWithZeros ( )
staticprivate

This fills the "faces" of the cube with zeros, because they do not have the necessary number of neighbors for a proper sum.

In practice the grid is probably much larger than the molecules, which means these locations do not contain any atom and therefore do not matter, but just in case...

Definition at line 168 of file AmbientOcclusion.cs.

References xDim, yDim, and zDim.

Referenced by AmbientOcclusion().

+ Here is the caller graph for this function:

void AmbientOcclusion.Occlude ( )

Perfoms the actual Ambient Occlusion operations.

Definition at line 272 of file AmbientOcclusion.cs.

References Molecule.Model.MoleculeModel.atomsColorList, fudgeFactor, BallUpdate.number, and BallUpdate.resetColors.

Referenced by AdvancedOptionsOldGUI.AdvOptions().

+ Here is the caller graph for this function:

void AmbientOcclusion.Revert ( )

Reverts the molecule to its original colors, that is before the Depth Cueing effect was applied.

Definition at line 328 of file AmbientOcclusion.cs.

References Molecule.Model.MoleculeModel.atomsColorList, originalColors, and BallUpdate.resetColors.

Referenced by AdvancedOptionsOldGUI.AdvOptions().

+ Here is the caller graph for this function:

static void AmbientOcclusion.SetOcclusionGridBounds ( )
staticprivate

Sets the occlusion grid bounds.

I.e. this function determines the highest and lowest densities found.

Definition at line 192 of file AmbientOcclusion.cs.

Referenced by AmbientOcclusion().

+ Here is the caller graph for this function:

static float AmbientOcclusion.WeightedAverageOfSurroundingCubes ( int  i,
int  j,
int  k 
)
staticprivate

Definition at line 135 of file AmbientOcclusion.cs.

References totalWeightFactor.

Referenced by AmbientOcclusion().

+ Here is the caller graph for this function:

Member Data Documentation

BallUpdate [] AmbientOcclusion.balls
staticprivate

Definition at line 71 of file AmbientOcclusion.cs.

float AmbientOcclusion.compensationFactor = 1.30f
staticprivate

Definition at line 92 of file AmbientOcclusion.cs.

const float AmbientOcclusion.cornerCoef = 0.25f
private

Definition at line 88 of file AmbientOcclusion.cs.

Vector3 AmbientOcclusion.delta
staticprivate

Definition at line 72 of file AmbientOcclusion.cs.

float [,,] AmbientOcclusion.density
staticprivate

Definition at line 69 of file AmbientOcclusion.cs.

const float AmbientOcclusion.diagCoef = 0.707106781186548f
private

Definition at line 87 of file AmbientOcclusion.cs.

const float AmbientOcclusion.faceCoef = 1f
private

Definition at line 86 of file AmbientOcclusion.cs.

Vector3 AmbientOcclusion.fudgeFactor
staticprivate

Definition at line 74 of file AmbientOcclusion.cs.

Referenced by Occlude().

PDBtoDEN AmbientOcclusion.genDensity
staticprivate

Definition at line 68 of file AmbientOcclusion.cs.

Vector3 AmbientOcclusion.inverseDelta
staticprivate

Definition at line 76 of file AmbientOcclusion.cs.

bool AmbientOcclusion.isEnabled = false
static

Definition at line 83 of file AmbientOcclusion.cs.

Referenced by AdvancedOptionsOldGUI.AdvOptions().

float AmbientOcclusion.maxDensity = -float.MaxValue
staticprivate

Definition at line 81 of file AmbientOcclusion.cs.

float AmbientOcclusion.minDensity = float.MaxValue
staticprivate

Definition at line 80 of file AmbientOcclusion.cs.

float [,,] AmbientOcclusion.occlusion
staticprivate

Definition at line 70 of file AmbientOcclusion.cs.

Vector3 AmbientOcclusion.origin = MoleculeModel.MinValue
staticprivate

Definition at line 73 of file AmbientOcclusion.cs.

List<Color> AmbientOcclusion.originalColors
staticprivate

Definition at line 78 of file AmbientOcclusion.cs.

Referenced by Revert().

GameObject AmbientOcclusion.pdb2den
staticprivate

Definition at line 67 of file AmbientOcclusion.cs.

bool AmbientOcclusion.reset = false
static

Definition at line 84 of file AmbientOcclusion.cs.

Referenced by AdvancedOptionsOldGUI.AdvOptions(), and Molecule3D.clearScene().

const float AmbientOcclusion.totalWeightFactor = 1f/(6f*faceCoef + 12f*diagCoef + 8f*cornerCoef)
private

Definition at line 89 of file AmbientOcclusion.cs.

Referenced by WeightedAverageOfSurroundingCubes().

bool AmbientOcclusion.weighted = true
staticprivate

Definition at line 91 of file AmbientOcclusion.cs.

int AmbientOcclusion.xDim
staticprivate

Definition at line 77 of file AmbientOcclusion.cs.

Referenced by AmbientOcclusion(), and FillFacesWithZeros().

int AmbientOcclusion.yDim
staticprivate

Definition at line 77 of file AmbientOcclusion.cs.

Referenced by AmbientOcclusion(), and FillFacesWithZeros().

int AmbientOcclusion.zDim
staticprivate

Definition at line 77 of file AmbientOcclusion.cs.

Referenced by AmbientOcclusion(), and FillFacesWithZeros().


The documentation for this class was generated from the following file: