Revision 47511918
Added by Leszek Koltunski about 6 years ago
src/main/res/raw/blit_depth_render_fragment_shader.glsl | ||
---|---|---|
18 | 18 |
////////////////////////////////////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
precision highp float; |
21 |
precision highp uint;
|
|
21 |
precision highp int; |
|
22 | 22 |
|
23 | 23 |
#if __VERSION__ != 100 |
24 | 24 |
out vec4 fragColor; // The output color |
... | ... | |
66 | 66 |
void main() |
67 | 67 |
{ |
68 | 68 |
uint index = uint(v_Pixel.x + v_Pixel.y * float(u_Size.x)); |
69 |
uint ptr = u_Records[index]; |
|
69 | 70 |
|
70 |
if( u_Records[index] == 0u ) discard;
|
|
71 |
if( ptr == 0u ) discard;
|
|
71 | 72 |
else |
72 | 73 |
{ |
73 |
index = u_Records[index]; |
|
74 |
FRAG_COLOR = convert(u_Records[index+2u]); |
|
74 |
u_Records[index] = 0u; |
|
75 |
vec4 color = convert(u_Records[ptr]); |
|
76 |
|
|
77 |
if( (4*int(v_Pixel.x) > u_Size.x) && color.r==1.0 ) FRAG_COLOR = color; |
|
78 |
else if( (4*int(v_Pixel.x) <=u_Size.x) && color.g==1.0 ) FRAG_COLOR = color; |
|
79 |
else FRAG_COLOR = vec4(0.0,0.0,1.0,1.0); |
|
80 |
//FRAG_COLOR = convert(u_Records[index]); |
|
81 |
//u_Records[index] = 0u; |
|
75 | 82 |
} |
76 | 83 |
|
77 |
u_Records[index] = 0u; |
|
78 |
|
|
79 | 84 |
/* |
80 | 85 |
uint index = uint(v_Pixel.x + v_Pixel.y * float(u_Size.x)); |
81 | 86 |
uint curr = u_Records[index]; |
Also available in: Unified diff
Order Independent Transparency: some progress