src/DebugShader.h

Go to the documentation of this file.
00001 #ifndef DEBUG_SHADER_H
00002 #define DEBUG_SHADER_H
00003 
00004 
00005 #include "Shader.h"
00006 
00007 
00013 class DebugShader : public Shader
00014 {
00015 public:
00020     DebugShader(Scene * scene)
00021         : Shader(scene)
00022     {
00023     }
00024 
00027     RGBAColor shade(const Ray & ray) const
00028     {
00029         RGBAColor result( ray.hit()->normal(ray).fabs() );
00030 
00031         // for each assigned texture do combine it
00032         for (unsigned int i=0; i < textureCount(); i++)
00033         {
00034              result.scale(texture(i)->texel(ray.hit()->texCoord(ray)).rgb());
00035         }
00036 
00037         return result;
00038     }
00039 };
00040 
00041 #endif
00042 

Generated on Fri Feb 1 00:01:42 2008 for Grayfall by  doxygen 1.5.1