copyimage.frag 475 Bytes
Newer Older
schultezub's avatar
schultezub committed
1
2
3

#include "tools/sampler2d.frag"

4
5
uniform vec2 _viewportSize;
uniform vec2 _viewportSizeRCP;
schultezub's avatar
schultezub committed
6
7
8
9
10
uniform sampler2D _colorTexture;
uniform sampler2D _depthTexture;
uniform TextureParameters _textureParameters;

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