LWJGL
May 20, 2012, 23:42:45 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Nullpointer number of texture units?  (Read 3587 times)
blue_tomato
Regular nerd
**
Posts: 72


« on: August 02, 2006, 05:36:08 »

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

Code:

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
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #1 on: August 02, 2006, 06:14:08 »

has the display been created ?
please provide the whole stacktrace
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
blue_tomato
Regular nerd
**
Posts: 72


« Reply #2 on: August 02, 2006, 07: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 Smiley

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
Logged
Evil-Devil
Prolific Timewaster
****
Posts: 268



WWW
« Reply #3 on: August 02, 2006, 07: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.
Logged
blue_tomato
Regular nerd
**
Posts: 72


« Reply #4 on: August 02, 2006, 10: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
Logged
Evil-Devil
Prolific Timewaster
****
Posts: 268



WWW
« Reply #5 on: August 03, 2006, 00: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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!