UnityMol  0.9.6-875
UnityMol viewer / In developement
Grayscale.cs
Go to the documentation of this file.
1 using System;
2 using UnityEngine;
3 
4 namespace UnityStandardAssets.ImageEffects
5 {
6  [ExecuteInEditMode]
7  [AddComponentMenu("Image Effects/Color Adjustments/Grayscale")]
8  public class Grayscale : ImageEffectBase {
9  public Texture textureRamp;
10 
11  [Range(-1.0f,1.0f)]
12  public float rampOffset;
13 
14  // Called by camera to apply image effect
15  void OnRenderImage (RenderTexture source, RenderTexture destination) {
16  material.SetTexture("_RampTex", textureRamp);
17  material.SetFloat("_RampOffset", rampOffset);
18  Graphics.Blit (source, destination, material);
19  }
20  }
21 }
void OnRenderImage(RenderTexture source, RenderTexture destination)
Definition: Grayscale.cs:15