Skip to content

Loading…

vwv OpenGL ERROR (1281) #20

Closed
khusmann opened this Issue · 1 comment

2 participants

@khusmann

On my netbook (again, with the less than powerful graphics card), when trying to view any plate I get:

Error: OpenGL ERROR (1281): invalid value

This is because vwv is trying to internally store its textures as float on the graphics card, which my card apparently doesn't support. Look at https://github.com/visionworkbench/visionworkbench/blob/master/src/vw/gui/GlPreviewWidget.cc#L317:

glTexImage2D(GL_TEXTURE_2D, 0, texture_pixel_type,
tile->cols(), tile->rows(), 0,
source_pixel_type, source_channel_type, tile->native_ptr().get() );

texture_pixel_type takes on the value of GL_RGBA32F_ARB (or something similar, depending on the pixel type). This mode isn't supported on my card, so as a hack I replace texture_pixel_type with tile->channels():

glTexImage2D(GL_TEXTURE_2D, 0, tile->channels(),
tile->cols(), tile->rows(), 0,
source_pixel_type, source_channel_type, tile->native_ptr().get() );

I think this allows the card to choose the best internal representation type. (My guess looking at http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml)

This isn't a really universal fix because I think using a float internal type might be essential for some of the pixel shader modes. The pixel shaders might have to be rewritten to accommodate an int-type internal representation in order to properly make this change.

@ScottMcMichael

This code was moved to the graveyard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.