summaryrefslogtreecommitdiffstats
path: root/Studio/Content/Effect Library/Gaussian Blur.effect
blob: 958d9fe742c060a73fb623706110d4ff52e78313 (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
48
<?xml version="1.0" encoding="UTF-8" ?>
<Effect>
	<MetaData>
		<!--Quickly blurs by an adjustable amount. Gaussian refers to the bell-shaped curve that is generated when the shader applies a weighted average to the pixels. The Gaussian Blur filter adds low-frequency detail and can produce a hazy effect.-->
                <Property name="BlurBias" formalName="Blurriness" min="0" max="10" default="2" description="0 = no blur\n10 = maximum blur" />
	</MetaData>
	<Shaders>
		<Shared>
#include "blur.glsllib"
		</Shared>
		<Shader name="HBLUR">
			<VertexShader>
void vert()
{
	SetupHorizontalGaussianBlur(Texture0Info.x, BlurBias, TexCoord);
}
			</VertexShader>
			<FragmentShader>
void frag()
{
    gl_FragColor = GaussianBlur(Texture0, Texture0Info.z);
} 
			</FragmentShader>
		</Shader>
		<Shader name="VBLUR">
			<VertexShader>
void vert()
{
	SetupVerticalGaussianBlur(Texture0Info.y, BlurBias, TexCoord);
}
			</VertexShader>
			<FragmentShader>

void frag() // PS_Blur_Vertical_9tap
{
    vec4 fragColor = GaussianBlur(Texture0, Texture0Info.z);    
    colorOutput(fragColor);
} 
			</FragmentShader>
		</Shader>
	</Shaders>
	<Passes>
	  <Buffer name="temp_buffer" type="ubyte" format="rgba" filter="linear" wrap="clamp" size="1.0" lifetime="frame"/>
	  <Pass name="1" shader="HBLUR" input="[source]" output="temp_buffer"/>
	  <Pass name="2" shader="VBLUR" input="temp_buffer"/>  
	</Passes>
</Effect>