-
Notifications
You must be signed in to change notification settings - Fork 1
/
VP_Flood.cg
35 lines (27 loc) · 995 Bytes
/
VP_Flood.cg
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
/*
Guodong Rong
VP_Flood.cg
The vertex program for JFA
Copyright (c) 2005-2006
School of Computing
National University of Singapore
All Rights Reserved.
*/
void main(float4 position : POSITION,
out float4 oPosition : POSITION,
out float4 oNeighborCoord01 : TEXCOORD0,
out float4 oNeighborCoord23 : TEXCOORD1,
out float4 oNeighborCoord56 : TEXCOORD2,
out float4 oNeighborCoord78 : TEXCOORD3,
uniform float4x4 cameraModelViewProj : state.matrix.mvp,
uniform float2 size,
uniform int steplength)
{
float4 pos4;
oPosition = mul(cameraModelViewProj, position);
pos4 = float4(position.xy, position.xy);
oNeighborCoord01 = pos4 + float4(-steplength, -steplength, 0, -steplength);
oNeighborCoord23 = pos4 + float4(steplength, -steplength, -steplength, 0);
oNeighborCoord56 = pos4 + float4(steplength, 0, -steplength, steplength);
oNeighborCoord78 = pos4 + float4(0, steplength, steplength, steplength);
} // main