forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilterDown4.py
More file actions
34 lines (32 loc) · 1.28 KB
/
filterDown4.py
File metadata and controls
34 lines (32 loc) · 1.28 KB
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
DOWN_4 = """
//Cg
void vshader(float4 vtx_position : POSITION,
out float4 l_position : POSITION,
out float2 l_texcoordNW : TEXCOORD0,
out float2 l_texcoordNE : TEXCOORD1,
out float2 l_texcoordSW : TEXCOORD2,
out float2 l_texcoordSE : TEXCOORD3,
uniform float4 texpad_src,
uniform float4 texpix_src,
uniform float4x4 mat_modelproj)
{
l_position=mul(mat_modelproj, vtx_position);
float2 c=(vtx_position.xz * texpad_src.xy) + texpad_src.xy;
l_texcoordNW = c + float2( texpix_src.x, -texpix_src.y);
l_texcoordNE = c + float2( texpix_src.x, texpix_src.y);
l_texcoordSW = c + float2(-texpix_src.x, -texpix_src.y);
l_texcoordSE = c + float2(-texpix_src.x, texpix_src.y);
}
void fshader(float2 l_texcoordNW : TEXCOORD0,
float2 l_texcoordNE : TEXCOORD1,
float2 l_texcoordSW : TEXCOORD2,
float2 l_texcoordSE : TEXCOORD3,
uniform sampler2D k_src : TEXUNIT0,
out float4 o_color : COLOR) {
float4 colorNW = tex2D(k_src, l_texcoordNW);
float4 colorNE = tex2D(k_src, l_texcoordNE);
float4 colorSW = tex2D(k_src, l_texcoordSW);
float4 colorSE = tex2D(k_src, l_texcoordSE);
o_color = (colorNW + colorNE + colorSW + colorSE);
}
"""