Revision ae2802b1
Added by Leszek Koltunski about 6 years ago
src/main/res/raw/blit_depth_vertex_shader.glsl | ||
---|---|---|
28 | 28 |
#endif |
29 | 29 |
|
30 | 30 |
uniform float u_Depth; // distance from the near plane to render plane, in clip coords |
31 |
uniform vec2 u_TexCorr; // when we blit from postprocessing buffers, the buffers can be |
|
32 |
// larger than necessary (there is just one static set being |
|
33 |
// reused!) so we need to compensate here by adjusting the texture |
|
34 |
// coords. |
|
31 | 35 |
|
32 | 36 |
////////////////////////////////////////////////////////////////////////////////////////////// |
33 | 37 |
|
34 | 38 |
void main() |
35 | 39 |
{ |
36 |
v_TexCoordinate = a_Position + 0.5;
|
|
40 |
v_TexCoordinate = (a_Position + 0.5) * u_TexCorr;
|
|
37 | 41 |
gl_Position = vec4(2.0*a_Position,u_Depth,1.0); |
38 | 42 |
} |
Also available in: Unified diff
Postprocessing buffers mBuffer[] are now shared among all postprocessing operations. This saves a lot of memory, but also means that when doing each particular postprocessing, the textures backing up the mBuffer might be too large. We need to fix two things here: when outputting to those too large textures, we need to adjust the Viewport, and when binding those too large textures as input - we need to adjust the TexCoords to compensate.
This commit does just that. Verified as working by the 'PostprocessTree' app.