Revision 2ab60f72
Added by Leszek Koltunski about 6 years ago
src/main/res/raw/main_fragment_shader.glsl | ||
---|---|---|
43 | 43 |
// next describes the Region, i.e. area over which the effect is active. |
44 | 44 |
#endif // NUM_FRAGMENT>0 |
45 | 45 |
|
46 |
layout (std140,binding=1) buffer SSBO // PER-SURFACE count of transparent fragments.
|
|
46 |
layout (std140,binding=0) buffer SSBO // PER-SURFACE count of transparent fragments.
|
|
47 | 47 |
{ // Can be buffered, i.e. if we are for example |
48 |
int count[]; // triple-buffered, then surfaceID=N uses 3
|
|
48 |
int ssbocount[]; // triple-buffered, then surfaceID=N uses 3
|
|
49 | 49 |
}; // consecutive counts (N,N+1,N+2) during 3 |
50 | 50 |
// consecutive frames. |
51 | 51 |
uniform int u_currentIndex; // Index into the count[] array we are supposed to be using |
... | ... | |
73 | 73 |
} |
74 | 74 |
#endif |
75 | 75 |
|
76 |
count[0]=17; |
|
76 |
ssbocount[0]=17;
|
|
77 | 77 |
|
78 | 78 |
FRAG_COLOR = vec4(color.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, color.a); |
79 | 79 |
} |
Also available in: Unified diff
SSBO: something is working already, although we still get the 4 bytes back from the shader in reverse order ( so '17'=0x00000011 written by the shader becomes '285212672 = 0x11000000' )