项目中用到关于温度云图效果,考虑到有些人对shader 的使用还不熟悉,所以下面就给大家介绍下使用shader实现温度云图的方法,希望能帮到大家。
Shader "Custom/TemperatureField" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Point1("Temperature1",Range(0,100)) = 50
_Point2("Temperature2",Range(0,100)) = 50
_Point3("Temperature3",Range(0,100)) = 50
_Point4("Temperature4",Range(0,100)) = 50
}
SubShader {
AlphaTest Greater 0.1
Pass {
CGPROGRAM
#pragma exclude_renderers d3d11 xbox360 gles
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _MainTex_ST;
float _Point1;
float _Point2;
float _Point3;
floa