Nullpointer number of texture units?

Started by blue_tomato, August 02, 2006, 12:36:08

Previous topic - Next topic

blue_tomato

Trying to read the number of texture units available, but I get a nullpointer exception on this line:

System.out.println("Number of texture units: " + Util.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS));


Seems like a LWJGL bug? Or, if not, how to find the number of texture units?

Using LWJGL v1.0 Beta 2

Matzon

has the display been created ?
please provide the whole stacktrace

blue_tomato

Quote from: "Matzon"has the display been created ?
please provide the whole stacktrace
Good point, the function works after the display is initiated :)

It reports 8 texture units in my case. As far as I know the minimum number is 2? Do you know what is normal on todays cards?

Thanks

Evil-Devil

The newest cards have 16. But those are only reachable via shader.
Current NVidia cards have 4 and ATI's 8 TUs that were direct usable from open gl via multitexturing. Everything above is as allready stated available via shaders.

blue_tomato

Quote from: "Evil-Devil"The newest cards have 16. But those are only reachable via shader.
Current NVidia cards have 4 and ATI's 8 TUs that were direct usable from open gl via multitexturing. Everything above is as allready stated available via shaders.

Interesting, I am using mostly shaders in fact, but what is considered a safe upper limit for todays cards? 16? Any way to detect the number of shader texture units to ensure a safe render path for lesser enabled cards?

Thanks

Evil-Devil

I think you should differ between cards with shader environment and without.
Any card without shader only have the fixed pipeline. Where the maximum is 4? Don't know how many MTUs old graphic cards have.

I found the information about how to determine the total amount of MTUs available in the dynamic pipeline via shader tech.
You have to query ARB_fragment_program.GL_MAX_TEXTURE_IMAGE_UNITS and ARG_fragment_prgram_GL_MAX_TEXTURE_COORS. Those two can be used independet of each other.

Hope that helps ya.

Evil