PDA

View Full Version : glError : GL_INVALID_ENUM



knackered
02-14-2002, 12:38 AM
Can anyone tell me why this gives an invalid enum error?

glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 12, GL_TEXTURE0_ARB, GL_IDENTITY_NV);

Thanks.

opla
02-14-2002, 12:59 AM
GL_TEXTURE0_ARB

glTrackMatrixNV is to use with matrices.
If you want to use the texture matrix, use GL_TEXTURE (from the doc: matrix must be one of NONE, MODELVIEW, PROJECTION, TEXTURE, COLOR)

ScottManDeath
02-14-2002, 02:00 AM
Hi

this is a quotation from the vertex_program.txt found at sgis opengl extensions registry
"(...)
Version 1.4

Allow TEXTUREi_ARB for the track matrix. This allows matrix
tracking of a particular texture matrix without reference to active
texture (set by glActiveTextureARB) state.

Early NVIDIA drivers (prior to October 5, 2001) have a bug
in their handling of tracking matrices specified with TEXTURE.
Rather than tracking the particular texture matrix indicated
by the active texture state when TrackMatrixNV is called, these
early drivers incorrectly track matrix the active texture's texture
matrix _at track matrix validation time_. In practice this means,
every tracked matrix defined with TEXTURE tracks the same matrix
values; you cannot track distinct texture matrices at the same
time and the texture matrix you actually track depends on the
active texture matrix at validation time. This is a driver bug.

Drivers after October 5, 2001 properly track the texture matrix
specified by active texture when TrackMatrix is called.

The new correct drivers can be distinguished from the old drivers
at run time with the following code:

while (glGetError() != GL_NO_ERROR); // Clear any pre-existing OpenGL errors.
glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 8, GL_TEXTURE0_ARB, GL_IDENTITY_NV);
if (glGetError() != GL_NO_ERROR) {
// Old buggy pre-version 1.4 drivers with GL_TEXTURE
// glTrackMatrixNV bug.
} else {
// Correct new version 1.4 drivers (or later) with GL_TEXTURE
// glTrackMatrixNV bug fixed and GL_TEXTUREi_NV support.

// Note: you may want to untrack the matrix at this point.
}
(..)"

Bye
ScottManDeath

knackered
02-14-2002, 02:20 AM
Ah, that would explain why the code worked on my home machine but not on my work one. I think I have pre-october01 drivers on my work machine.
Thanks for the help, scottmandeath.
Opla, there was no need to patronise me, I'm aware of the use of glTrackMatrix, otherwise why would I be using it?

opla
02-14-2002, 02:38 AM
Opla, there was no need to patronise me, I'm aware of the use of glTrackMatrix, otherwise why would I be using it?
I wasn't aware of the use of TEXTUREi_ARB for glTrackMatrixNV. http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_program.txt is the spec version 1.3, where is the version 1.4 ?

ScottManDeath
02-14-2002, 02:43 AM
Originally posted by opla:
where is the version 1.4 ?


Hi
http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_VERTEX_PROGRAM.TXT

Bye
ScottManDeath

[This message has been edited by ScottManDeath (edited 02-14-2002).]

[This message has been edited by ScottManDeath (edited 02-14-2002).]

opla
02-14-2002, 02:54 AM
Indeed, the spec version 1.4 allow TEXTUREi_ARB for the track matrix.
Thanks.
PS : the extension registry should be updated more often. (for example, GL_ATI_element_array is missing)