-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathHorizontal.fx
85 lines (76 loc) · 2.22 KB
/
Horizontal.fx
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
float2 ViewportSize : VIEWPORTPIXELSIZE;
static float2 ViewportOffset = 0.5 / ViewportSize;
static float2 ViewportOffset2 = 1.0 / ViewportSize;
static float ViewportAspect = ViewportSize.x / ViewportSize.y;
#define POST_STEREOSCOPIC_MODE 4
#include "stereoscopic.fxsub"
float AcsTr : CONTROLOBJECT<string name = "(self)"; string item = "Tr";>;
texture ScnMap : RENDERCOLORTARGET <
float2 ViewPortRatio = {1.0,1.0};
bool AntiAlias = false;
string Format = "A2R10G10B10";
>;
sampler ScnSamp = sampler_state {
texture = <ScnMap>;
MinFilter = POINT; MagFilter = POINT; MipFilter = NONE;
AddressU = CLAMP; AddressV = CLAMP;
};
texture DepthMap : OFFSCREENRENDERTARGET<
string Description = "Depth Map";
float2 ViewPortRatio = {1.0, 1.0};
string Format = "R16F";
float4 ClearColor = { 1, 0, 0, 0 };
float ClearDepth = 1.0;
string DefaultEffect =
"self = hide;"
"*fog.pmx=hide;"
"*controller.pmx=hide;"
"*editor*.pmx=hide;"
"*.pmx=Depth.fx;"
"*.pmd=Depth.fx;"
"*.x=hide;";
>;
sampler DepthMapSamp = sampler_state {
texture = <DepthMap>;
MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = NONE;
AddressU = CLAMP; AddressV = CLAMP;
};
texture2D DepthBuffer : RENDERDEPTHSTENCILTARGET<
float2 ViewportRatio = {1.0,1.0};
string Format = "D24S8";
>;
void ScreenSpaceQuadVS(
in float4 Position : POSITION,
in float2 Texcoord : TEXCOORD0,
out float2 oTexcoord : TEXCOORD0,
out float4 oPosition : POSITION)
{
oTexcoord = Texcoord + ViewportOffset.xy;
oPosition = Position;
}
float Script : STANDARDSGLOBAL <
string ScriptOutput = "color";
string ScriptClass = "scene";
string ScriptOrder = "postprocess";
> = 0.8;
const float4 ClearColor = float4(0,0,0,0);
const float ClearDepth = 1.0;
technique MainTech <
string Script =
"RenderColorTarget=ScnMap;"
"RenderDepthStencilTarget=DepthBuffer;"
"ClearSetColor=ClearColor;"
"ClearSetDepth=ClearDepth;"
"Clear=Color;"
"Clear=Depth;"
"ScriptExternal=Color;"
"RenderColorTarget=;"
"Pass=Stereoscopic;"
;>{
pass Stereoscopic<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 StereoscopicPS(ScnSamp, DepthMapSamp);
}
}