copyimage.frag 388 Bytes
Newer Older
schultezub's avatar
schultezub committed
1

schultezub's avatar
schultezub committed
2
#include "tools/texture2d.frag"
schultezub's avatar
schultezub committed
3

4
5
uniform vec2 _viewportSize;
uniform vec2 _viewportSizeRCP;
schultezub's avatar
schultezub committed
6
7
uniform Texture2D _colorTexture;
uniform Texture2D _depthTexture;
schultezub's avatar
schultezub committed
8
9

void main() {
10
    vec2 fragCoord = gl_FragCoord.xy * _viewportSizeRCP;
schultezub's avatar
schultezub committed
11
12
    gl_FragData[0] = getElement2DNormalized(_colorTexture, fragCoord);
    gl_FragDepth = getElement2DNormalized(_depthTexture, fragCoord).z;
schultezub's avatar
schultezub committed
13
}