summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/resolve.glsl
blob: 6acc712299d3f8afb7e6500d8184662401c9bb22 (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
[vertex]


layout(location=0) in highp vec4 vertex_attrib;
layout(location=4) in vec2 uv_in;

out vec2 uv_interp;


void main() {

	uv_interp = uv_in;
	gl_Position = vertex_attrib;
}

[fragment]


in vec2 uv_interp;
uniform sampler2D source_specular; //texunit:0
uniform sampler2D source_ssr; //texunit:1

uniform float stuff;

in vec2 uv2_interp;

layout(location = 0) out vec4 frag_color;

void main() {

	vec4 specular = texture( source_specular,  uv_interp );

#ifdef USE_SSR

	vec4 ssr = textureLod(source_ssr,uv_interp,0.0);
	specular.rgb = mix(specular.rgb,ssr.rgb*specular.a,ssr.a);
#endif

	frag_color = vec4(specular.rgb,1.0);
}