0
$\begingroup$

I’m looking to somehow programmatically query the state of graphics during a PC gameplay session. What I mean by “state of graphics” is, how polygons, textures, lighting and any other scene elements are stored and computed for any particular frame. I’m mainly interested in what the graphics card is doing on a low level.

Is there any need to be game engine specific in this matter, or will all games be drawn to the screen in the same way?

I’m specifically interested in NVIDIA cards if at all possible. I’m not sure if different manufacturers do things differently, but I only have an NVIDIA card.

Are there any tools or APIs that will give me access to this data?

$\endgroup$
3
  • 1
    $\begingroup$ "What I mean by “state of graphics” is, how polygons, textures, lighting and any other scene elements are stored and computed for any particular frame." That kind of thing changes within a frame. Indeed, the graphics card doesn't even know what "lighting" or a "scene element" is in most cases. It's just executing user-written programs that ultimately write data into blocks of memory that the GPU will eventually send to the display device. It has no idea what any of it means. $\endgroup$ Apr 30, 2020 at 22:50
  • 1
    $\begingroup$ GPUs do so must stuff that even if you could read that info you probably wouldn't get any meaningfull information. You're better off using a profiling tool for your game engine to view this info. Also this question seems off-topic for this stackoverflow. $\endgroup$
    – zoran404
    Apr 30, 2020 at 22:51
  • $\begingroup$ @zoran404 After rereading the on topic help pages I can see, why you come to the conclusion that this question might be off-topic. However, I think it is at least disputable and I would consider it okay. $\endgroup$
    – wychmaster
    May 1, 2020 at 9:46

1 Answer 1

1
$\begingroup$

What I mean by “state of graphics” is, how polygons, textures, lighting and any other scene elements are stored and computed for any particular frame.

The closest to what you are asking and that I know of is RenderDoc. I have not tested it myself so far, but some features they list in their documentation that are related to your question are:

  • Full graphics pipeline state display
  • Shader source display
  • Flexible resource inspector
  • Mesh buffer inspection and visualisation
  • ‘Raw’ buffer inspection for buffers
  • Texture/render target viewer

I’m looking to somehow programmatically query the state of graphics during a PC gameplay session.

...

Is there any need to be game engine specific in this matter, or will all games be drawn to the screen in the same way?

I am not sure here if you are asking to dissect the graphics state of a commercial game or software that is not written by yourself. If so, there is no guarantee that RenderDoc can capture data but it is possible. See for example this issue on their GitHub page, where the author says:

However I want to be clear that I cannot and do not support capturing 3rd party programs that you do not control. It generally works but for obvious reasons I don't provide any help with problems...

As stated in this section of their documentation, RenderDoc uses a "man-in-the-middle" approach to get the data. So it intercepts any calls to the graphics API (OpenGL, DirectX, Vulkan) of the executed program, gathers the data it needs, and passes it along to the API afterward.

$\endgroup$
1
  • $\begingroup$ For Nvidia cards, O.P can also use NSight (developer.nvidia.com/nsight-graphics). It provides more low-level and performance information than RenderDoc. I don't think it can be used on a released commercial application however, you probably need to have access to the application sources first. $\endgroup$
    – wip
    May 4, 2020 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.