UnityMol  0.9.6-875
UnityMol viewer / In developement
UnityStandardAssets.ImageEffects.ContrastStretch Class Reference
+ Inheritance diagram for UnityStandardAssets.ImageEffects.ContrastStretch:
+ Collaboration diagram for UnityStandardAssets.ImageEffects.ContrastStretch:

Public Attributes

float adaptationSpeed = 0.02f
 
float limitMinimum = 0.2f
 
float limitMaximum = 0.6f
 
Shader shaderLum
 
Shader shaderReduce
 
Shader shaderAdapt
 
Shader shaderApply
 

Properties

Material materialLum [get]
 
Material materialReduce [get]
 
Material materialAdapt [get]
 
Material materialApply [get]
 

Private Member Functions

void Start ()
 
void OnEnable ()
 
void OnDisable ()
 
void OnRenderImage (RenderTexture source, RenderTexture destination)
 
void CalculateAdaptation (Texture curTexture)
 

Private Attributes

RenderTexture[] adaptRenderTex = new RenderTexture[2]
 
int curAdaptIndex = 0
 
Material m_materialLum
 
Material m_materialReduce
 
Material m_materialAdapt
 
Material m_materialApply
 

Detailed Description

Definition at line 8 of file ContrastStretch.cs.

Member Function Documentation

void UnityStandardAssets.ImageEffects.ContrastStretch.CalculateAdaptation ( Texture  curTexture)
private

Helper function to do gradual adaptation to min/max luminances.

Definition at line 173 of file ContrastStretch.cs.

void UnityStandardAssets.ImageEffects.ContrastStretch.OnDisable ( )
private

Definition at line 116 of file ContrastStretch.cs.

void UnityStandardAssets.ImageEffects.ContrastStretch.OnEnable ( )
private

Definition at line 105 of file ContrastStretch.cs.

void UnityStandardAssets.ImageEffects.ContrastStretch.OnRenderImage ( RenderTexture  source,
RenderTexture  destination 
)
private

Apply the filter.

Definition at line 135 of file ContrastStretch.cs.

void UnityStandardAssets.ImageEffects.ContrastStretch.Start ( )
private

Definition at line 91 of file ContrastStretch.cs.

Member Data Documentation

float UnityStandardAssets.ImageEffects.ContrastStretch.adaptationSpeed = 0.02f

Adaptation speed - percents per frame, if playing at 30FPS.

Default is 0.02 (2% each 1/30s).

Definition at line 13 of file ContrastStretch.cs.

RenderTexture [] UnityStandardAssets.ImageEffects.ContrastStretch.adaptRenderTex = new RenderTexture[2]
private

Definition at line 31 of file ContrastStretch.cs.

int UnityStandardAssets.ImageEffects.ContrastStretch.curAdaptIndex = 0
private

Definition at line 32 of file ContrastStretch.cs.

float UnityStandardAssets.ImageEffects.ContrastStretch.limitMaximum = 0.6f

The limit on the maximum luminance (0...1) - we won't go below this.

Definition at line 26 of file ContrastStretch.cs.

float UnityStandardAssets.ImageEffects.ContrastStretch.limitMinimum = 0.2f

If our scene is really dark (or really bright), we might not want to stretch its contrast to the full range.

limitMinimum=0, limitMaximum=1 is the same as not applying the effect at all. limitMinimum=1, limitMaximum=0 is always stretching colors to full range. The limit on the minimum luminance (0...1) - we won't go above this.

Definition at line 22 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.m_materialAdapt
private

Definition at line 66 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.m_materialApply
private

Definition at line 80 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.m_materialLum
private

Definition at line 37 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.m_materialReduce
private

Definition at line 52 of file ContrastStretch.cs.

Shader UnityStandardAssets.ImageEffects.ContrastStretch.shaderAdapt

Definition at line 65 of file ContrastStretch.cs.

Shader UnityStandardAssets.ImageEffects.ContrastStretch.shaderApply

Definition at line 79 of file ContrastStretch.cs.

Shader UnityStandardAssets.ImageEffects.ContrastStretch.shaderLum

Definition at line 36 of file ContrastStretch.cs.

Shader UnityStandardAssets.ImageEffects.ContrastStretch.shaderReduce

Definition at line 51 of file ContrastStretch.cs.

Property Documentation

Material UnityStandardAssets.ImageEffects.ContrastStretch.materialAdapt
getprotected

Definition at line 67 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.materialApply
getprotected

Definition at line 81 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.materialLum
getprotected

Definition at line 38 of file ContrastStretch.cs.

Material UnityStandardAssets.ImageEffects.ContrastStretch.materialReduce
getprotected

Definition at line 53 of file ContrastStretch.cs.


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