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         
public float rampOffset;
11
12         
// Called by camera to apply image effect
13         
void OnRenderImage (RenderTexture source, RenderTexture destination) {
14             material.SetTexture(
"_RampTex", textureRamp);
15             material.SetFloat(
"_RampOffset", rampOffset);
16             Graphics.Blit (source, destination, material);
17         }
18     }
19 }


Called by camera to apply image effect



Gõ tìm kiếm nhanh...