Revision f89a986e
Added by Leszek Koltunski about 6 years ago
src/main/res/raw/blit_depth_render_fragment_shader.glsl | ||
---|---|---|
17 | 17 |
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. // |
18 | 18 |
////////////////////////////////////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 |
precision lowp float;
|
|
20 |
precision highp float;
|
|
21 | 21 |
precision highp uint; |
22 | 22 |
|
23 | 23 |
#if __VERSION__ != 100 |
... | ... | |
66 | 66 |
void main() |
67 | 67 |
{ |
68 | 68 |
uint index = uint(v_Pixel.x + v_Pixel.y * float(u_Size.x)); |
69 |
|
|
70 |
if( u_Records[index] == 0u ) discard; |
|
71 |
else |
|
72 |
{ |
|
73 |
index = u_Records[index]; |
|
74 |
FRAG_COLOR = convert(u_Records[index+2u]); |
|
75 |
} |
|
76 |
|
|
77 |
u_Records[index] = 0u; |
|
78 |
|
|
79 |
/* |
|
80 |
uint index = uint(v_Pixel.x + v_Pixel.y * float(u_Size.x)); |
|
69 | 81 |
uint curr = u_Records[index]; |
70 | 82 |
|
71 | 83 |
if (curr == 0u) discard; |
... | ... | |
83 | 95 |
if( color.a == 0.0 ) color = vec4(0.0,1.0,0.0,1.0); |
84 | 96 |
} |
85 | 97 |
|
98 |
|
|
99 |
if( curr>0u ) |
|
100 |
{ |
|
101 |
curr = u_Records[curr]; |
|
102 |
color= convert(u_Records[curr+2u]); |
|
103 |
} |
|
104 |
|
|
86 | 105 |
gl_FragDepth = TEXTURE(u_DepthTexture, v_TexCoordinate).r; |
87 | 106 |
FRAG_COLOR = color; |
88 | 107 |
|
89 | 108 |
//else |
90 | 109 |
// FRAG_COLOR = vec4(1.0,0.0,0.0,1.0); |
110 |
*/ |
|
91 | 111 |
} |
Also available in: Unified diff
Order Independent Transparency: some progress