English feliratok

← Debugging Shaders - Interactive 3D Graphics

Beágyazókód kérése
2 Languages

Showing Revision 2 created 05/24/2016 by Udacity Robot.

  1. In this exercise, you'll start with a different procedural texture. It works
  2. fine, but I want you to know about an important debugging technique. Since you
  3. can't put break points inside a shader, it's hard to know what's going on. The
  4. answer is to send various shader computations to the screen itself. In other
  5. words, instead of putting your final result into GL_FRAGColor, put these other
  6. intermediate values. In fact, you have three whole color channels to use and
  7. view on the screen. Your task is to send the following program values, diffuse,
  8. ugain alpha, and attenuation to each of these channels. All three of these
  9. values is in the proper range of zero to one, so need no adjustment. Here's
  10. what things will look like when you're done. Under material control in the user
  11. interface is a slider called gain alpha. So, I think it will change the green
  12. channel to match the value selected. One bit to notice in the code is that
  13. there's a sub routine called compute bias. It's fine to use sub routines inside
  14. shaders, and they have a C language type of interface.