Project

General

Profile

« Previous | Next » 

Revision 12f45260

Added by Leszek Koltunski about 6 years ago

First try at the SSBO (doesn't work - reads in the application don't pick up changes in the shader; crashes.

View differences:

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.
47
  {                                     // Can be buffered, i.e. if we are for example
48
  int count[];                          // triple-buffered, then surfaceID=N uses 3
49
  };                                    // consecutive counts (N,N+1,N+2) during 3
50
                                        // consecutive frames.
51
uniform int u_currentIndex;             // Index into the count[] array we are supposed to be using
52
                                        // during this very invocation.
53

  
46 54
//////////////////////////////////////////////////////////////////////////////////////////////
47 55

  
48 56
void main()                    		
......
65 73
    }
66 74
#endif
67 75

  
76
  count[0]=17;
77

  
68 78
  FRAG_COLOR = vec4(color.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, color.a);
69 79
  }

Also available in: Unified diff