I would like to downsample my depth buffer and my normals.
For that, I take in input of my shader, the corresponding textures (depth, normal), and I write my new values in a multi render target.
I downsample the normals by doing a simple average of four texels and for the depth buffer, I can choose the max or min of four texels.
My color attachment's format for the downsampled buffer is R32F.
How could I write my new depth floating point value in it?
gl_FragData.r = newDepth;
But it doesn't seem to store correctly a float with 32 bits precision.
To get a pixel's depth, I know that I can do:
float depth = texture2D(depth, tc).x;
But what about to output a single float with 32 bits precision?