blob: 1121f0d05c55d42447dc181f04ae71c181c4d254 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
Shader "Hidden/Preview_ConditionalIfNode"
{
Properties
{
_A ( "_A", 2D) = "white" {}
_B ( "_B", 2D ) = "white" {}
_C ( "_AGreaterThanB", 2D ) = "white" {}
_D ( "_AEqualToB", 2D ) = "white" {}
_E ( "_ALessThanB", 2D ) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
uniform sampler2D _A;
uniform sampler2D _B;
uniform sampler2D _C;
uniform sampler2D _D;
uniform sampler2D _E;
float4 frag ( v2f_img i ) : SV_Target
{
float aVal = tex2D ( _A, i.uv ).r;
float bVal = tex2D ( _B, i.uv ).r;
float4 aGreaterbVal = tex2D ( _C, i.uv );
float4 aEqualbVal = tex2D ( _D, i.uv );
float4 aLessbVal = tex2D ( _E, i.uv );
if ( aVal > bVal )
return aGreaterbVal;
if ( aVal == bVal )
return aEqualbVal;
return aLessbVal;
}
ENDCG
}
}
}
|