FlatTransparentShader.h

Go to the documentation of this file.
00001 
00007 #ifndef FLATTRANSPARENTSHADER_H
00008 #define FLATTRANSPARENTSHADER_H FLATTRANSPARENTSHADER_H
00009 
00010 #include "Shader.h"
00011 
00016 class FlatTransparentShader : public Shader
00017 {
00018 public:
00023     FlatTransparentShader(Scene *scene)
00024         : Shader(scene)
00025     {};
00026 
00031     ColorRGBA Shade(Ray &ray)
00032     {     
00033         Ray trans;
00034         trans.org = ray.org + ray.t*ray.dir;
00035         trans.dir = ray.dir;
00036         trans.bounces = ray.bounces +1;
00037         
00038         ColorRGBA ct = scene->RayTrace(trans);
00039         if (mTexture.size() > 0) 
00040         {
00041             const ColorRGBA tex = getTexture(0)->GetTexel(ray.hit->GetUV(ray));
00042             return ct.interpolated(tex, tex.alpha());
00043         }
00044         else 
00045             return ct;
00046     };
00047 };
00048 
00049 #endif

Generated on Thu Jan 31 21:48:48 2008 for RayTracer by  doxygen 1.5.4