Loading...
Logo
Processing Forum
I wrote an aplication that works with image's pixels. The array has an average of 76800 objects of "Pixel". 
On processing-1.5.1 this aplication works perfectly! 

But when i try to run the same app on processing-2.0a5, the app crashes and it shows a warning on log saying:

"OpenGL error 1280 at top beginDraw(): invalid enumerant"
"P3D: tessellated arrays are overflowing"

Actually the app doesn't crash but it seems like; it runs very slowly.

I've tried to run on processing-2.0a4, the same problem happened but the warning message : 
"P3D: tessellated arrays are overflowing" doesn't show.

Obs.:
 - I'm using P3D -> size(200, 200, P3D);
 - ArrayList pDinamico  = new ArrayList(); (pDinamico is the array of "Pixel" object)

Thanks!

Replies(11)

Hey I have the same problem....

So far I could only find this part of code that generates the message (from http://code.google.com/p/processing/source/browse/trunk/processing/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java?r=9447), but I don't know how to handle this. Any ideas?

Copy code
  1.     tessellate(mode);
    
        if (flushMode == FLUSH_CONTINUOUSLY ||
            (flushMode == FLUSH_WHEN_FULL && tessGeo.isFull())) {
    
          if (flushMode == FLUSH_WHEN_FULL && tessGeo.isOverflow()) {
            PGraphics.showWarning("P3D: tessellated arrays are overflowing");
          }
    
          flush();
        }
      
Hello, the fix for this issue is already checked in the repo, and will be available in the next release. However, if you post a simple code snippet reproducing the error, I will test it on my development version.
Hi Andreas...

I've made this example to show what's happening.

Its good to remember that code works great on processing 1.5.1, but on 2.0a5 shows the error message below:

"OpenGL error 1280 at top beginDraw(): invalid enumerant" - What that means?
"P3D: tessellated arrays are overflowing"  - What that means? Array is too big?

I know this is a lot of objects inside an ArrayList, but why this code works fine on processing 1.5.1;

Thanks!

Copy code
  1. int tam;
  2. ArrayList<Pixel> listOfPixels;
  3. int angle;

  4. void setup(){
  5.   size(600,600,P3D);
  6.   //number of 'pixels'
  7.   tam = 78000;
  8.   angle = 0;
  9.   listOfPixels = new ArrayList<Pixel>();
  10.   for(int i=0;i<tam;i++){
  11.     Pixel p = new Pixel(int(random(width)),int(random(height)),-int(random(255)) );
  12.     listOfPixels.add(p);
  13.   }
  14. }

  15. void draw(){
  16.   background(0);
  17.   angle++;
  18.   translate(width/2,height/2);
  19.   rotateY(angle*TWO_PI/360);
  20.   translate(-width/2,-height/2);  
  21.   for(Pixel p : listOfPixels){
  22.     stroke(p.c);
  23.     point(p.x,p.y,p.z);
  24.     point(p.x,p.y,-p.z);    
  25.     p.updateZ();
  26.   }
  27. }

  28. class Pixel{
  29.   int x,y,z;
  30.   color c;

  31.   public Pixel(int x, int y, int z){
  32.     this.x = x;
  33.     this.y = y;
  34.     this.z = z;
  35.     this.c = color((int)random(255),(int)random(255),(int)random(255));
  36.   }  
  37.   
  38.   void updateZ(){
  39.     this.x = int(random(width));
  40.     this.y = int(random(height));
  41.     this.z = int(random(255));    
  42.   }
  43. }

I tested your code with the latest processing build from the trunk, and there is no error. However, it will run quite slowly unless you set strokeCap(SQUARE) in setup. This is due to the way Processing now generates stroke geometry, in the case of points, it generates fully tessellated ellipses or squares (depending on the stroke cap setting) made out of triangles. This gives you the possibility of creating points of arbitrary size, but the downside is that pushes more geometry through the video card (before, a single vertex per point, now 5 in the case of square caps, many more if using round caps).
Andreas, thanks a lot!

But for me this not good, cause, now to run this application on a newer version of Processing i should use a better video card. 

Is it possible to use an older version of  the class (used on processing 1.5.1), that creates a single vertex per point, on a newer version of processing an compile it?

One more question:

"OpenGL error 1280 at top beginDraw(): invalid enumerant" - What's that means? This message still showing;

But for me this not good, cause, now to run this application on a newer version of Processing i should use a better video card.
The new P2D and P3D renderers in Processing 2.0 are entirely based on OpenGL. The advantage is better performance in most situations, however they won't work on older video cards that don't support OpenGL features such as GLSL shaders.

Is it possible to use an older version of  the class (used on processing 1.5.1), that creates  a single vertex per point, on a newer version of processing an compile it?
No, it is not possible. I realize that the new point rendering is less efficient than in the older OPENGL renderer, since it renders full triangle fans per point instead of single vertices. As I mentioned, this gives the possibility of drawing points of arbitrary size (otherwise point size is hardware limited), but at the cost of pushing at least 5 times more geometry through the video card. The solution for this issue would be to add an optional rendering path in P2D/P3D that draws points in the old way (with the GL_POINTS primitive), as long as the stroke weight is below the maximum hardware limit for point size. When the weight goes beyond this limit, the more expensive rendering path would be chosen instead. Because of time constrains and in order to keep the new code relatively simple, I didn't implement these two different paths and points are always drawn using triangle fans. This could be added later, though.

One more question:

"OpenGL error 1280 at top beginDraw(): invalid enumerant" - What's that means? This message still showing; 
Is this error showing up with the sketch you posted before? 
Could you run the following snippet of code and let me know of the output you get in the console?
Copy code
  1. size(100, 100, P3D);
  2. PGraphics3D pg = (PGraphics3D) g;

  3. println(pg.OPENGL_VENDOR);
  4. println(pg.OPENGL_RENDERER);
  5. println(pg.OPENGL_VERSION);
  6. println(pg.OPENGL_EXTENSIONS);
  7. println(pg.maxLineWidth);
  8. println(pg.maxPointSize);

Dear Andres,

the snippet you posted on Processing 2.05 alpha gives me the error

"Cannot find a class or type named "PGraphics3D" "   . Shouldnt the size(100, 100, P3D); already import the OPENGL classes?

Another question, so I understand:
From what I understand of your previous post and seeing when my program runs into mistakes, its a matter of drawing points at arbitrary sizes. My question: Does that mean that the problem arises when I am trying to draw to big or to small points?


My apologies, I inadvertently run the code with the development version instead with 2.0a5. Just replace PGraphics3D with PGraphicsOpenGL.

As for your question, there are two different things going on here. The "P3D: tessellated arrays are overflowing" error that appears in 2.0a5 has been fixed already, and the next release of Processing will include the fix. 

All my additional comments just stress that point rendering in Processing 2.0 (irrespective of the point size) is more demanding than in the older OpenGL renderer in 1.5. So for the time being, I recommend to use strokeCap(SQUARE), which will result in faster rendering, particularly for large amount of points. Of course, points will look square, but this should be ok if you are using a small stroke weight, or if you want them to look like that.
Andres thanks a lot!

It should be my Intel(R) Q45/Q43 Express Chipset problem! 
But I've checked and it seems like that this chipset supports GLSL.

Cause i founded that -> GL_ARB_shading_language_100

This is the output of your skecth running on the last release of Processing (0205 not the 2.0a5):


OpenGL error 1280 at top beginDraw(): invalid enumerant
Intel
Intel(R) Q45/Q43 Express Chipset
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_blend_color
GL_EXT_abgr
GL_EXT_texture3D
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_SGIS_texture_edge_clamp
GL_SGIS_generate_mipmap
GL_EXT_draw_range_elements
GL_SGIS_texture_lod
GL_EXT_rescale_normal
GL_EXT_packed_pixels
GL_EXT_texture_edge_clamp
GL_EXT_separate_specular_color
GL_ARB_multitexture
GL_EXT_texture_env_combine
GL_EXT_bgra
GL_EXT_blend_func_separate
GL_EXT_secondary_color
GL_EXT_fog_coord
GL_EXT_texture_env_add
GL_ARB_texture_cube_map
GL_ARB_transpose_matrix
GL_ARB_texture_env_add
GL_IBM_texture_mirrored_repeat
GL_EXT_multi_draw_arrays
GL_NV_blend_square
GL_ARB_texture_compression
GL_3DFX_texture_compression_FXT1
GL_EXT_texture_filter_anisotropic
GL_ARB_texture_border_clamp
GL_ARB_point_parameters
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_env_crossbar
GL_EXT_texture_compression_s3tc
GL_ARB_shadow
GL_ARB_window_pos
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_ARB_vertex_program
GL_EXT_texture_rectangle
GL_ARB_fragment_program
GL_EXT_stencil_two_side
GL_ATI_separate_stencil
GL_ARB_vertex_buffer_object
GL_EXT_texture_lod_bias
GL_ARB_occlusion_query
GL_ARB_fragment_shader
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_texture_non_power_of_two
GL_ARB_vertex_shader
GL_NV_texgen_reflection
GL_ARB_point_sprite
GL_EXT_blend_equation_separate
GL_ARB_depth_texture
GL_ARB_texture_rectangle
GL_ARB_draw_buffers
GL_ARB_color_buffer_float
GL_ARB_half_float_pixel
GL_ARB_texture_float
GL_ARB_pixel_buffer_object
GL_EXT_framebuffer_object
GL_ARB_draw_instanced
GL_ARB_half_float_vertex
GL_EXT_draw_buffers2
GL_WIN_swap_hint
GL_EXT_texture_sRGB
GL_EXT_packed_float
GL_EXT_texture_shared_exponent
GL_ARB_texture_rg
GL_ARB_texture_compression_rgtc
GL_NV_conditional_render
GL_EXT_texture_swizzle
GL_ARB_framebuffer_sRGB
GL_EXT_packed_depth_stencil
GL_ARB_depth_buffer_float
GL_EXT_transform_feedback
GL_EXT_framebuffer_blit
GL_ARB_framebuffer_object
GL_ARB_vertex_array_object
7.0
255.0

And I also uploaded an *.txt file that i export from ' GPU Caps Viewer'.


Does the code I've written ran normaly, using as you said ' strokeCap(SQUARE)', on your machine?

Are you using MAC?

Unfortunately I wanna dots, not points looking like square... But is ok.

Thanks again!


Perhaps I can add some information to help determine the issue:
  • On my somewhat older desktop I always get the "OpenGL error 1280 at top beginDraw(): invalid enumerant" warning with Processing 1.5.1. + GLGraphics version: 1.0.0.
  • I don't get this warning in Processing 2.0a5.
  • I have found it to be harmless. All the code runs fine. When I run the same code on my newer laptop, all is fine (code runs, no warning).
So it seems to be a warning triggered by older graphics cards.

When I run the code snippet provided by andres I get the following output:

ATI Technologies Inc.
ATI Radeon HD 4800 Series
2.1.8086 Release
GL_AMDX_vertex_shader_tessellator
GL_AMD_performance_monitor
GL_AMD_texture_texture4
GL_ARB_color_buffer_float
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_instanced
GL_ARB_fragment_program
GL_ARB_fragment_shader
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_instanced_arrays
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_shader_objects
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shadow
GL_ARB_shadow_ambient
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_ATI_draw_buffers
GL_ATI_envmap_bumpmap
GL_ATI_fragment_shader
GL_ATI_meminfo
GL_ATI_separate_stencil
GL_ATI_texture_compression_3dc
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_copy_texture
GL_EXT_depth_buffer_float
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_float
GL_EXT_packed_pixels
GL_EXT_point_parameters
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_EXT_subtexture
GL_EXT_texgen_reflection
GL_EXT_texture3D
GL_EXT_texture_compression_latc
GL_EXT_texture_compression_rgtc
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_rectangle
GL_EXT_texture_sRGB
GL_EXT_texture_shared_exponent
GL_EXT_vertex_array
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_texgen_reflection
GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod
GL_WIN_swap_hint
WGL_EXT_swap_control
128.0
8192.0

btw, 2.0a6 is out now, which incorporates the fix I mentioned earlier.