Project

General

Profile

« Previous | Next » 

Revision 21304c55

Added by Leszek Koltunski over 7 years ago

Progress with TransferFeedback app - introduce two modes: USEPOINTS 'true' or 'false'.

On Nexus5X, it works with 'true' and 'false'. On Nexus 4, it works with 'true', but returns GL_INVALID_OPERATION with 'false'.

View differences:

src/main/java/org/distorted/library/DistortedEffects.java
287 287

  
288 288
  void drawPriv(float halfW, float halfH, MeshObject mesh, DistortedOutputSurface surface, long currTime)
289 289
    {
290
    int error;
291

  
290 292
    mM.compute(currTime);
291 293
    mV.compute(currTime);
292 294
    mF.compute(currTime);
......
313 315
    GLES30.glBindBufferBase(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0, mesh.mPosTBO[0]);
314 316

  
315 317
    GLES30.glBeginTransformFeedback(GLES30.GL_TRIANGLES);
316
    GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, mesh.dataLength);
317 318

  
318
    int error = GLES30.glGetError();
319
    error = GLES30.glGetError();
320
    if (error != GLES30.GL_NO_ERROR)
321
      {
322
      throw new RuntimeException("1 glError 0x" + Integer.toHexString(error));
323
      }
324

  
325
    GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, mesh.dataLength);
319 326

  
327
    error = GLES30.glGetError();
320 328
    if (error != GLES30.GL_NO_ERROR)
321 329
      {
322
      throw new RuntimeException("glError 0x" + Integer.toHexString(error));
330
      throw new RuntimeException("2 glError 0x" + Integer.toHexString(error));
323 331
      }
324 332

  
325 333
    GLES30.glEndTransformFeedback();
src/main/res/raw/feedback_fragment_shader.glsl
19 19

  
20 20
precision mediump float;
21 21

  
22
#if __VERSION__ != 100
23
out vec4 fragColor;           // The output color
24
#define FRAG_COLOR fragColor
25
#else
26
#define FRAG_COLOR gl_FragColor
27
#endif
22
out vec4 fragColor;
28 23

  
29 24
//////////////////////////////////////////////////////////////////////////////////////////////
30 25

  
31 26
void main()                    		
32 27
  {
33
  FRAG_COLOR = vec4(1.0,1.0,1.0,1.0);
28
  fragColor = vec4(1.0,1.0,1.0,1.0);
34 29
  }
src/main/res/raw/feedback_vertex_shader.glsl
19 19

  
20 20
precision lowp float;
21 21

  
22
#if __VERSION__ != 100
22
#if USEPOINTS == 1
23 23
in float inValue;
24 24
out float outValue;
25 25
#else
26
attribute float inValue;
27
varying float outValue;
26
in vec3 inValue;
27
out vec3 outValue;
28 28
#endif
29 29

  
30 30
//////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff