Tips

A list of things to take care of while writing OpenGL/GLSL programs. Some might seem stupid, but I faced those problems in the past and hell some were really nasty for a novice. So I decided to write them down here to help others learning..

[GLSL]

  • NEVER EVER use the discard keyword when doing MRTs !! By doing so, the discard keyword will create a blackhole corresponding to the current fragment that will suck into itself every other fragment in the same x,y coordinate on different RTs…

[OpenGL]

  • Initialize textures before using them in Framebuffer Objects !
  • FP16 numbers only have 11 bits of significand (10 exponent bits and the implied 1.). The rest of the bits are exponent (5 bits) and a sign bit.
  • What are the most expensive state changes?
    • Binding a Shader
    • Binding a Texture
    • Updating a GLSL texture sampler uniform
    • VBO data pointers
    • Everything else
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: