41 static inline void loadBar(
int x,
int n,
int r,
int w);
51 void bind(
Scene *_scence,
Film *_film,
Camera *_camera,
int _max_depth,
int _anti_aliasing, std::string _image_name);
71 bool raycast(ngl::Vec3 _from,
int _avoid);
83 ngl::Colour
trace(ngl::Vec3 _from, ngl::Vec3 _direction,
int _depth);
void render()
Will trigger the class and start doing all the calculations.
Camera * m_camera
Associated camera.
Film * m_film
Associated film.
int m_anti_aliasing
Antialiasing amount.
Core of my program, central unit that manages all the other classes almost.
Implements camera functionability, no transformations, just explicit definition.
All the operations regarding to file output and file input belong to this class. It abstracts the ide...
int m_height
Height of the image.
This hold all the objects and lights that the parser interpred and later pushed into the scene...
~Renderer()
Destructor, frees any possible memory from the heap.
Renderer()
Constructor for the renderer class.
static void loadBar(int x, int n, int r, int w)
Implements a loading bar. This algorithm is taken from another person.
int m_width
Width of the image.
int m_max_depth
Maximum number of ray stack frames.
ngl::Vec3 m_bg_colour
default background colour.
Scene * m_scene
Associated scene.
int getIndexClosest(std::vector< double > _intersections)
Given an intersections vector will return the closest to the camera, the one that it will read colour...
void bind(Scene *_scence, Film *_film, Camera *_camera, int _max_depth, int _anti_aliasing, std::string _image_name)
Grabs all the information and places it into the private interface.
std::string m_image_name
Name of the filename that will be written.
ngl::Colour trace(ngl::Vec3 _from, ngl::Vec3 _direction, int _depth)
Probably the most important algorithm of this class. This method is recursive. It will fire a ray fro...
bool raycast(ngl::Vec3 _from, int _avoid)
Will fire rays from a position, then iterate over the lights, and if any object is inbetweet will ret...
Holds all the operations regarding to input/output of colour information.
Hold all the objects and lights of the scene.
Holds camera functions which will be accessed by the Render class.