Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Detecting Pixel Shader Version


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Cygon   Crossbones+   -  Reputation: 1141

Like
0Likes
Like

Posted 08 November 2007 - 08:28 PM

I'm trying to detect the Pixel Shader version of the installed graphics card. Can anyone give me some advice on how this can be achieved with OpenGL? Before you recommend that I just check for the GL extensions my game needs -- I am writing an installer for a Direct3D game of all things, and using DirectX to query for the shader version is not an option when DirectX might not even be installed on the target system yet :) Thanks, -Markus-

Sponsor:

#2 haegarr   Crossbones+   -  Reputation: 4580

Like
0Likes
Like

Posted 08 November 2007 - 08:54 PM

Quote:
Original post by Cygon
I'm trying to detect the Pixel Shader version of the installed graphics card. Can anyone give me some advice on how this can be achieved with OpenGL?

AFAIK the way to go is: When you've detected the OpenGL version via
  glGetString(GL_VERSION)
and the version is at least 2.0, then you can use
  glGetString(GL_SHADING_LANGUAGE_VERSION)
to get the GLSL version. For OpenGL below 2.0 you have to check for the extension
  ARB_SHADING_LANGUAGE_100
what obviously means that GLSL 1.0.0 is available if the extension is resolved, else no GLSL is available at all.

You have to check some compatibility charts if you want to derive a Direct3D compliant version information.

Quote:
Original post by Cygon
Before you recommend that I just check for the GL extensions my game needs -- I am writing an installer for a Direct3D game of all things, and using DirectX to query for the shader version is not an option when DirectX might not even be installed on the target system yet :)

Err, what? We shouldn't recommend to use GL extension checking because Direct3D may not be installed? I don't understand.

However, checking for hardware details w/o using a standardized API ... well, that probably becomes a mess. But perhaps your target OS provides some way besides the gfx API. But even if so, that would still no guarantee that the gfx API / driver used later will provide you a matching shader language just only because of the hardware is available.

#3 Cygon   Crossbones+   -  Reputation: 1141

Like
0Likes
Like

Posted 08 November 2007 - 09:45 PM

Quote:
Original post by haegarr
Err, what? We shouldn't recommend to use GL extension checking because Direct3D may not be installed? I don't understand.


I was thinking along the lines that you might want to persuade me to just check that the graphics card has the extensions / capabilities my game needs instead of trying to find out the shader version.

Ergo I added that I really need the actual pixel shader version because I'm writing this code to check for a compatible graphics card in the installer of a D3D game. I decided to do this check via OpenGL because the installer might be run on systems where DX is not yet installed.

Hope that clears it up ;)

-Markus-

#4 Kalidor   Members   -  Reputation: 1087

Like
0Likes
Like

Posted 09 November 2007 - 06:15 AM

These shader models are a purely Direct3D thing, OpenGL has no concept of them. You can query support for the various hardware capabilities relating to specific shader models by querying the relevant extensions. A quick google came up with this page.

I still don't get it though... if your game is a D3D game then it obviously needs D3D installed before someone can play it, so why not check the shader model after you finish installing it?

#5 Cygon   Crossbones+   -  Reputation: 1141

Like
0Likes
Like

Posted 09 November 2007 - 07:05 AM

Well, I want my setup to tell the user when his system is incapable of running the game before he spends an eternity installing tons of stuff including .NET 2.0, XNA, the VC2005 SP1 runtime, Ageia PhysX and of course DirectX 9.0c.

Maybe an image says more than a thousand words:


I finally found some code in the Wine D3D wrapper that tries to guess the shader version based on OpenGL extensions and limits:
http://source.winehq.org/source/dlls/wined3d/directx.c

Thanks for the link. I'm slowly getting all the pieces together :)

-Markus-

#6 Kalidor   Members   -  Reputation: 1087

Like
0Likes
Like

Posted 09 November 2007 - 07:18 AM

Quote:
Original post by Cygon
Well, I want my setup to tell the user when his system is incapable of running the game before he spends an eternity installing tons of stuff including .NET 2.0, XNA, the VC2005 SP1 runtime, Ageia PhysX and of course DirectX 9.0c.
Okay, I see what you mean. Perhaps you can run the install for DX first, if needed, and then check the hardware caps before installing everything else? Another thing to consider is that the user's video card drivers may not be up-to-date so their OpenGL implementation may not support something that their hardware actually does support.

#7 Cygon   Crossbones+   -  Reputation: 1141

Like
0Likes
Like

Posted 09 November 2007 - 07:40 AM

Yes, I'm aware of that. All I want to do is fire a message box like "setup could not detect any shader 2.0 capable hardware in your system. This game requires a graphics card which supports shader model 2.0. Continue anyway?"

Perhaps add a recommendation to download the latest drivers and combine everything with a backup check via D3D (if available before the install, afaik Windows XP SP2 ships with D3D9) and I should be catching most of the compatibility issues before the installer has even modified the system.

-MArkus-





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS