-
Notifications
You must be signed in to change notification settings - Fork 0
/
竖屏转横屏-阵列单行-带黑边.hlsl
42 lines (36 loc) · 969 Bytes
/
竖屏转横屏-阵列单行-带黑边.hlsl
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
// $MinimumShaderProfile: ps_3_0
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);
#define screen_width 1920
#define screen_height 1080
#define split_v 1
#define black_border true
#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])
#define PI acos(-1)
#define split (screen_width * height * split_v / screen_height / width)
#define one_over_split (1/split)
#define padding (split%1/2/split)
#define padding_ (one_over_split - padding )
float4 main(float2 tex : TEXCOORD0) : COLOR
{
if(split > 1 || split_v > 1 ){
float4 c0 =float4(0,0,0,0);
if(black_border){
if(tex.x >= padding && tex.x + padding <1)
tex.x =( tex.x - padding) * split % 1;
else
return c0;
} else {
tex.x =( tex.x + padding_) * split % 1;
}
tex.y = tex.y * split_v % 1;
return tex2D(s0, tex);
}
return tex2D(s0, tex);
}