00001 /********************************************************************** 00002 * blaRAY -- photon mapper/raytracer 00003 * (C) 2008 by Tomasz bla Fortuna <bla@thera.be>, <bla@af.gliwice.pl> 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * any later version. 00009 * 00010 * See Docs/LICENSE 00011 *********************/ 00012 00013 #ifndef _RAYTRACER_H_ 00014 #define _RAYTRACER_H_ 00015 00016 #include <vector> 00017 00018 #include "General/Types.hh" 00019 #include "Render/Renderer.hh" 00020 00021 #include "Math/Matrix.hh" 00022 #include "Math/Transform.hh" 00023 #include "Math/Vector.hh" 00024 00025 #include "World/Scene.hh" 00026 #include "World/Camera.hh" 00027 00028 #include "Graphics/Image.hh" 00029 #include "Graphics/Screen.hh" 00030 00041 namespace Render { 00042 00048 class Raytracer : public Renderer { 00050 const World::Scene &Scene; 00051 00053 const Bool Antialiasing; 00054 00057 static const Int AASize; 00058 00060 const Int MaxDepth; 00061 00063 Int ShadowRays; 00064 Int ReflectedRays; 00065 Int RefractedRays; 00071 std::vector<Double> RefractiveStack; 00072 00084 inline void TraceLights( 00085 const Math::Vector &ColPoint, 00086 const Math::Vector &Normal, 00087 const Ray &Reflect, 00088 World::Color &Diffuse, 00089 World::Color &Specular); 00090 00091 00103 Bool Trace(const Ray &R, 00104 World::Color &C, 00105 const Int Depth, 00106 const Double CurIdx); 00107 00108 public: 00114 Raytracer(const World::Scene &Scene, 00115 const Bool Antialiasing = true, 00116 const Int MaxDepth = 5); 00117 00121 void Render(Graphics::Drawable &Img); 00122 00123 }; 00124 }; 00125 00126 #endif
1.5.5