You are viewing dmalcolm

 
 
12 April 2009 @ 05:47 pm
How not to render 3D graphics: 40 ways to get a blank black screen  
I've learned most of these the hard way:
  • The monitor is in power-saving mode
  • Your video card has two outputs, and the monitor is plugged into the wrong one.
  • The screensaver kicked in while you were talking to your boss, but your program has grabbed input focus.
  • You've forgotten to flip the display buffers. You're drawing everything OK, but not displaying it.
  • There's a bug in your memory management. You're rendering to a different area of video RAM than the one the monitor is reading from.
  • Your scene is too complex; either the CPU or CPU crashed before the first frame finished rendering.
  • The "near" clip plane is further away than the "far" clip plane
  • You're rejecting the wrong side of each line as you walk your BSP tree; your universe is hiding just beyond the corner of your eye.
  • You forgot to set up the bounding-boxes for your objects, and all of them are being rejected as too small
  • You have a bug in your matrix library. The entire universe has collapsed to (0,0,0).
  • You have a bug in your quaternion library. All of your rotated objects are collapsing to points.
  • You have a bug in your back-face culling. Every face is being culled.
  • Your camera is too narrow angle; the universe has collapsed to a single point directly ahead of you
  • Your camera's so wide-angle... (insert mother joke)
  • You've confused the origins of screen space and of the frame buffer, and all of the scene is being rendered off the side of the framebuffer (and culled per-fragment)
  • You're using index-colour, and you forgot to set up a palette: all colours are black.
  • Your scale is wildly wrong: the scene is vastly larger than you expect. You are viewing a single texel on a single triangle in the scene.
  • Your scale is wildly wrong: the scene is vastly smaller than you expect. The entire world has collapsed to a tiny point in the centre of the screen.
  • The camera is outside the scene and pointing the wrong way. Did you try looking behind you? Above you? etc
  • You forgot to add any lights to the scene. Darkness remains over the surface of the deep.
  • You forgot to set the textures. All of the scene is being rendered with a blank texture.
  • You forgot to set any UV coordinates. The entire scene is being rendered with the colour at (0,0) in their textures.
  • You're doing integer multiplication of fractions and everything is coming out as zero.
  • You've forgotten to offset the objects in the scene in world space and relative to the camera. You are viewing all of the visible objects in the scene from inside, and back-face culling ensures that nothing is visible. (Insert bad pun about "Lost In Translation")
  • You've forgotten to pop matrices from the transformation stack, and you overflowed the stack after a few frames. (You should check error codes at least once per frame)
  • Your collision algorithms aren't good enough. The object representing the camera has fallen through the floor and is hurtling at great speed downwards into nothingness whilst the world disappears high above.
  • Your geometry shader has a bug, and all geometry in the scene is appearing behind the camera
  • Your fragment shader failed to compile, and everything is coming out as black.
  • You forgot to clear the z-buffer, and all of your fragments are being rejected.
  • Your scene is foggier than a lazy TV remake of Sherlock Holmes.
  • You forgot to set up alpha values, and the entire world is fully-transparent.
  • You're standing in front of a black wall.
  • The game logic has decided that we're fading out the screen, in preparation for the next level.
  • You set up all of your data correctly, but a stray pointer is trashing one/all of the above.
  • The in-game menus have appeared, overlaid in front of your scene. Unfortunately, due to poor state management, they're far too big, and a single corner of one letter "A" is obscuring the entire screen with black.
  • Your radiosity renderer doesn't have enough photons.
  • Your volume shader is too opaque.
  • Your bidirectional reflectance distribution functions aren't reflective enough
  • Time is running at a different rate than it should be, and your simulation code has either destroyed all of the objects in the scene, or none have been created yet.
  • There's a FIXME in your code that really needs fixing...
 
 
 
( 2 comments — Leave a comment )
noahhsnoahhs on April 13th, 2009 07:08 pm (UTC)
That, my friend, is awesome. I salute you.
1pound on June 1st, 2010 11:37 am (UTC)
You would be surprised how many people are victim to the first point, i love the "You're standing in front of a black wall." that made me giggle. North London Glaziers
( 2 comments — Leave a comment )