For debugging it may be useful to see all the OPENGL commands being sent to the GPU, the textures, mesh data, shaders, etc.
RenderDoc makes that possible.
This is how I got it running in Ubuntu:
- Download RenderDoc. In my case I downloaded the source and compiled it to have the latest version. This installed the file
/usr/lib/librenderdoc.so. In ArchLinux I would use the system package instead of compiling.
- In Idea, go to
Run > Edit Configurations...and under
LD_PRELOAD=/usr/lib/librenderdoc.so(or whatever is the path to the library in your case). (thanks @edwin)
- Launch the RenderDoc program (in my case called
- Start your OPENRNDR program. There should be a new text overlay on the top part of the window.
Inactive Window, then it changes to this:
- In RenderDoc, go to
File > Attach to Running Instance, choose the java program listed and then click
Connect to App.
- Now you can press F12 while your OPENRNDR program is focused and all the frame details will be transferred to RenderDoc, where you can explore GL calls, textures, mesh data, shaders in use, etc.
Here a screenshot of the program:
And exploring the mesh in RenderDoc:
Does the approach differ in Mac / Windows?