"check before flight" list - for OpenGL

Started by
5 comments, last by Katie 8 years, 1 month ago

hi there,

today I had the idea to write a list of things to check if there's nothing rendered on screen, for newbies.

I think this would tremendously help them, especially if there would be a piece of code that check each of these.

If you have any additions to this list, please comment it below.

-is there any opengl context?

-is any kind of swapbuffer called?

-is it called after everything has been rendered?

-what kind of frame buffer object are you rendering into?

-if you are using shaders, do you bind the correct one?

-are the shader uniforms bound?

-are shaders compiled and linked properly?

-is there any vertex buffer object, vertex array object bound?

-is there any index buffer object bound?

-if you are using textures, are the textures bound?

-are you using the depth state that you want to use?

-is blending enabled?

-are you using the blending function you wanted to use?

-is scissoring enabled?

-is backface culling enabled?

etc.

please contribute to this list :)

Advertisement

Great list, but I'd like to add that one should also test for OpenGL errors.

Aether3D Game Engine: https://github.com/bioglaze/aether3d

Blog: http://twiren.kapsi.fi/blog.html

Control

Greate list, but I'd like to add that one should also test for OpenGL errors.

of course :)

Couple of additions:

- Is it initialized properly? (For libraries like glew).

- Do you have an extension library? (To load extensions ofc- again glew).

- Do you have the extension you want to use? (Something uncommong but might occur)

Great list, if I had this when i started i'd save myself at least a day worth of work laugh.png

-Are your matrices correctly set? ( world, view, and most importantly, projection)

Edit: Also, if I'm unsure if things are working, I usually change the clear color from frame to frame. That way I know that the window and the context is working, and the draw calls are actually happening. This can also show that buffers are swapped if necessary.

Subsets of the above:

  • Are you sure you translated along the Z axis in the correct direction? (I should know on this one)
  • Did you translate it far enough from the camera? (i.e. beyond the near plane)
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
  • Did you clear the depth buffer before trying to using it.

This topic is closed to new replies.

Advertisement