Hello Guest

Nullpointer number of texture units?

  • 5 Replies
  • 10574 Views
Nullpointer number of texture units?
« on: August 02, 2006, 12:36:08 »
Trying to read the number of texture units available, but I get a nullpointer exception on this line:

Code: [Select]

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

*

Offline Matzon

  • *****
  • 2242
Nullpointer number of texture units?
« Reply #1 on: August 02, 2006, 13:14:08 »
has the display been created ?
please provide the whole stacktrace

Nullpointer number of texture units?
« Reply #2 on: August 02, 2006, 14:05:29 »
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

Nullpointer number of texture units?
« Reply #3 on: August 02, 2006, 14:17:30 »
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.

Nullpointer number of texture units?
« Reply #4 on: August 02, 2006, 17:51:29 »
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

Nullpointer number of texture units?
« Reply #5 on: August 03, 2006, 07:23:02 »
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