• Advertisement
  • entries
  • comments
  • views

Part 8: Learning the Programmable Pipeline

Sign in to follow this  


So, I've been spending some time working on that cubic-surface project I posted this week. That version had some nifty geometry creation (and by extension, animation) - I now want to put some lighting in.

I've been basing my code, in part, on the book I have - but the basic diffuse equation is simple enough to work out and implement for a point light.

Thing is, I messed it all up [grin]

I'm not 100% convinced it's fixed now, but I'm pretty sure it was just some n00b error of forgetting to keep values in the same coordinate space and a few +'s and -'s the wrong way around [rolleyes]

But the cool thing that I'm wanting to write about - and the reason I know why my shader was broken - is the DirectX SDK's shader debugger. That thing is absolutely frickin' amazing!! [grin]

I wonder if OpenGL has a similar tool for GLSL, cos if it doesn't they're really missing out [oh].
  1. Make sure all software is installed, SDK's and so on...
  2. Launch the DirectX Control Panel
  3. Switch to the debug runtime
  4. Load up Visual C++ 7.0 and my shader project
  5. Change my device init to use software vertex processing: D3DCREATE_SOFTWARE_VERTEXPROCESSING.
  6. Make sure that D3DXSHADER_SKIPOPTIMIZATION and D3DXSHADER_DEBUG are specified when compiling the shader from a file
  7. Load up the vertex shader code into VStudio (even has proper syntax highlighting)
  8. Place breakpoints as you would normally when debugging with VStudio
  9. Hit the "Debug" -> "Direct3D" -> "Start With Direct3D Debugging" menu item
  10. Wait for the breakpoints to be triggered, and check the values

Steps 5 and 6 can be easily done with a #define based on the _DEBUG symbol so as to require no manual changes later on.

Tools like this, PIXfW, DXTEX and the HLSL compiler make the DX SDK rock - I almost get worried that they're making it too easy [grin]

Sign in to follow this  


Recommended Comments

I still haven't used the shader debugger, but when I get home I think I might try it out. But from what I hear from Superpig, the original PIX (for Xbox) is simply godly. Apparently he can do things like select a pixel and trace its entire history in the frame O_O

Share this comment

Link to comment
It's one of the annoying things about my being 4 SDK refreshes behind - PIXfW has (apparently) come on leaps and bounds from the one I have installed to the extent it seems like it's at least close to the XBox PIX [sad]


Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement