|
Path Tracer
|
Stores object groups and a camera for the render. More...
#include <Scene.h>
Public Member Functions | |
| Scene (PerspectiveCamera camera=PerspectiveCamera(), unsigned int samplesPerPixel=8, unsigned int minBounces=5) | |
| Main constructor. More... | |
| Scene (const Scene &scene) | |
| Copy constructor. More... | |
| std::vector< Object3DGroup > | getObjectGroups () const |
| Getter for the object groups. More... | |
| std::vector< Object3DGroup > & | getObjectGroupsReference () |
| Getter for a reference to the object groups. More... | |
| std::vector< Object3D * > | getObjects () |
| Getter for the objects. More... | |
| std::vector< Object3D * > | getLamps () |
| Getter for the lamps. More... | |
| PerspectiveCamera | getCamera () const |
| Getter for the camera. More... | |
| PerspectiveCamera & | getCameraReference () |
| Getter for a reference to the camera. More... | |
| unsigned int | getSamplesPerPixel () const |
| Getter for the number of samples per pixel. More... | |
| unsigned int | getMinBounces () const |
| Getter for the minimum number of bounces. More... | |
| bool | getRussianRoulette () const |
| Getter for the russian roulette. More... | |
| double | getRrStopProbability () const |
| Getter for the russian roulette stop probability. More... | |
| bool | getNextEventEstimation () const |
| Getter for the next event estimation. More... | |
| unsigned int | getNumberThreads () const |
| Getter for the number of CPU threads. More... | |
| bool | getKDTree () const |
| Getter for the k-d tree option. More... | |
| unsigned int | getKDMaxObjectNumber () const |
| Getter for the maximum number of objects in a k-d tree leaf. More... | |
| unsigned int | getKDMaxDepth () const |
| Getter for the maximum depth recursion of the k-d tree. More... | |
| std::string | getBackupFileName () const |
| Getter for the name of the file in which backups will be made. More... | |
| bool | getBackupParameters () const |
| Getter for the option to backup the parameters. More... | |
| bool | getBackupObjectGroups () const |
| Getter for the option to backup the object groups. More... | |
| bool | getBackupPicture () const |
| Getter for the option to backup the picture. More... | |
| double | getLeastRenderTime4PictureBackup () const |
| Getter for the least render time after which the picture is backed up. More... | |
| void | setObjectGroups (std::vector< Object3DGroup > groups) |
| Setter for the object groups. More... | |
| void | setCamera (PerspectiveCamera camera) |
| Setter for the camera. More... | |
| void | setSamplesPerPixel (unsigned int samplesPerPixel) |
| Setter for the number of samples per pixel. More... | |
| void | setMinBounces (unsigned int minBounces) |
| Setter for the minimum number of bounces. More... | |
| void | setRussianRoulette (bool russianRoulette) |
| Setter for the russian roulette. More... | |
| void | setRussianRoulette (bool russianRoulette, double rrStopProbability) |
| Setter for the russian roulette and russian roulette stop probability. More... | |
| void | setRrStopProbability (double rrStopProbability) |
| Setter for the russian roulette stop probability. More... | |
| void | setNextEventEstimation (bool nextEventEstimation) |
| Setter for the next event estimation. More... | |
| void | setNumberThreads (unsigned int numberThreads) |
| Setter for the number of CPU threads. More... | |
| void | setKDTree (bool kdTree) |
| Setter for the k-d tree. More... | |
| void | setKDMaxObjectNumber (unsigned int kdMaxObjectNumber) |
| Setter for the maximum number of objects in a k-d tree leaf. More... | |
| void | setKDMaxDepth (unsigned int kdMaxDepth) |
| Setter for the maximum depth recursion of the k-d tree. More... | |
| void | setBackupFileName (std::string backupFileName) |
| Setter for the new name of the file in which backups will be made. More... | |
| void | setBackupParameters (bool backupParameters) |
| Setter for the option to backup the parameters. More... | |
| void | setBackupObjectGroups (bool backupObjectGroups) |
| Setter for the option to backup the object groups. More... | |
| void | setBackupPicture (bool backupPicture) |
| Setter for the option to backup the picture. More... | |
| void | setLeastRenderTime4PictureBackup (double leastRenderTime4PictureBackup) |
| Setter for the least render time after which the picture is backed up. More... | |
| void | addObjectGroup (const Object3DGroup &group) |
| Adds an object group to the current ones. More... | |
| void | resetAndDeleteObjectGroups () |
| Deletes all object groups and their objects. More... | |
| void | computeObjectsAndLamps () |
| Computes all the objects. More... | |
| void | defaultScene () |
| Sets this scene's objects to default ones. More... | |
| void | saveParameters2File (std::string fileName) const |
| Saves parameters to a file. More... | |
| void | saveObjectGroups2File (std::string fileName) const |
| Saves object groups to a file. More... | |
| bool | importFBXFile (const char *filePath, Material *material, std::string name) |
| Imports a fbx file as triangles. More... | |
| Picture * | render () |
| Start the render of the picture. More... | |
| void | displayParametersPage (bool displayIndexes=true) const |
| Prints the parameters page. More... | |
| void | displayObjectsPage () const |
| Prints the objects page. More... | |
Stores object groups and a camera for the render.
| Scene::Scene | ( | PerspectiveCamera | camera = PerspectiveCamera(), |
| unsigned int | samplesPerPixel = 8, |
||
| unsigned int | minBounces = 5 |
||
| ) |
Main constructor.
| camera | The camera that will be used for the render. |
| samplesPerPixel | The number of ray casted per pixel. Increasing it will give a higher quality, but at a cost of a linearly increasing time. |
| minBounces | The minimum number of bounces that each ray will do before beginning to use the russian roulette algorithm. |
| Scene::Scene | ( | const Scene & | scene | ) |
Copy constructor.
| scene | The scene that will be copied. |
| void Scene::addObjectGroup | ( | const Object3DGroup & | group | ) |
Adds an object group to the current ones.
| group | The object group that will be added. |
| void Scene::computeObjectsAndLamps | ( | ) |
Computes all the objects.
Also stores a vector of all objects having an emitance strictly greater than 1, to go faster with the next event estimation algorithm.
| void Scene::defaultScene | ( | ) |
Sets this scene's objects to default ones.
The look is similar to the Cornell box.
| void Scene::displayObjectsPage | ( | ) | const |
| void Scene::displayParametersPage | ( | bool | displayIndexes = true | ) | const |
Prints the parameters page.
This is one of the main pages.
| displayIndexes | If true it will print the indexes before each parameter. This is useful if for the user to be able to change them, but you can remove them if you only want the information (during the render, for example). |
| std::string Scene::getBackupFileName | ( | ) | const |
Getter for the name of the file in which backups will be made.
Every backup will be done with the same file name, but using a different file extension.
| bool Scene::getBackupObjectGroups | ( | ) | const |
Getter for the option to backup the object groups.
| bool Scene::getBackupParameters | ( | ) | const |
Getter for the option to backup the parameters.
| bool Scene::getBackupPicture | ( | ) | const |
Getter for the option to backup the picture.
| PerspectiveCamera Scene::getCamera | ( | ) | const |
Getter for the camera.
| PerspectiveCamera & Scene::getCameraReference | ( | ) |
Getter for a reference to the camera.
| unsigned int Scene::getKDMaxDepth | ( | ) | const |
Getter for the maximum depth recursion of the k-d tree.
One of the two recursion stop conditions, along with Scene::getKDMaxObjectNumber(). If one of them is fulfilled, the k-d tree recursive creation stops. See my TM's report for further information on this data structure.
| unsigned int Scene::getKDMaxObjectNumber | ( | ) | const |
Getter for the maximum number of objects in a k-d tree leaf.
One of the two recursion stop conditions, along with Scene::getKDMaxDepth(). If one of them is fulfilled, the k-d tree recursive creation stops. See my TM's report for further information on this data structure.
| bool Scene::getKDTree | ( | ) | const |
Getter for the k-d tree option.
See my TM's report for further information on this data structure.
| std::vector< Object3D * > Scene::getLamps | ( | ) |
Getter for the lamps.
Calls computeObjectsAndLamps().
| double Scene::getLeastRenderTime4PictureBackup | ( | ) | const |
Getter for the least render time after which the picture is backed up.
If this value is set to 0.0, the picture will always be backed up after the render.
| unsigned int Scene::getMinBounces | ( | ) | const |
Getter for the minimum number of bounces.
| bool Scene::getNextEventEstimation | ( | ) | const |
Getter for the next event estimation.
See my TM's report for further information on this algorithm.
| unsigned int Scene::getNumberThreads | ( | ) | const |
Getter for the number of CPU threads.
| std::vector< Object3DGroup > Scene::getObjectGroups | ( | ) | const |
Getter for the object groups.
| std::vector< Object3DGroup > & Scene::getObjectGroupsReference | ( | ) |
Getter for a reference to the object groups.
| std::vector< Object3D * > Scene::getObjects | ( | ) |
Getter for the objects.
Calls computeObjectsAndLamps().
| double Scene::getRrStopProbability | ( | ) | const |
Getter for the russian roulette stop probability.
Russian roulette stop probability that will be used during the render.
| bool Scene::getRussianRoulette | ( | ) | const |
Getter for the russian roulette.
See my TM's report for further information on this algorithm.
| unsigned int Scene::getSamplesPerPixel | ( | ) | const |
Getter for the number of samples per pixel.
| bool Scene::importFBXFile | ( | const char * | filePath, |
| Material * | material, | ||
| std::string | name | ||
| ) |
Imports a fbx file as triangles.
Uses the FBX SDK library.
| filePath | The path to the fbx file. |
| material | The material that will be used for all the triangles which will be imported. |
| name | The name of the object group in which all triangles will be stored. |
| Picture * Scene::render | ( | ) |
Start the render of the picture.
This uses the path tracing algorithm (I guess this information was not useful, as it is in the title) and some optimisations such as next event estimation and russian roulette path termination.
| void Scene::resetAndDeleteObjectGroups | ( | ) |
Deletes all object groups and their objects.
| void Scene::saveObjectGroups2File | ( | std::string | fileName | ) | const |
Saves object groups to a file.
| fileName | The name of the file to which the object groups will be saved. It is recommended that this file extension ends with OBJECTS_SAVE_EXTENSION. |
| void Scene::saveParameters2File | ( | std::string | fileName | ) | const |
Saves parameters to a file.
| fileName | The name of the file to which the prameters will be saved. It is recommended that this file extension ends with PARAMETERS_SAVE_EXTENSION. |
| void Scene::setBackupFileName | ( | std::string | backupFileName | ) |
Setter for the new name of the file in which backups will be made.
Every backup will be done with the same file name, but using a different file extension.
| backupFileName | The name of the file in which backups will be made. |
| void Scene::setBackupObjectGroups | ( | bool | backupObjectGroups | ) |
Setter for the option to backup the object groups.
| backupObjectGroups | Whether the object groups will be backed up before the render. |
| void Scene::setBackupParameters | ( | bool | backupParameters | ) |
Setter for the option to backup the parameters.
| backupParameters | Whether the parameters will be backed up before the render. |
| void Scene::setBackupPicture | ( | bool | backupPicture | ) |
Setter for the option to backup the picture.
| backupPicture | Whether the picture will be backed up after the render. |
| void Scene::setCamera | ( | PerspectiveCamera | camera | ) |
Setter for the camera.
| camera | The new camera that will be used during the render. |
| void Scene::setKDMaxDepth | ( | unsigned int | kdMaxDepth | ) |
Setter for the maximum depth recursion of the k-d tree.
One of the two recursion stop conditions, along with Scene::setKDMaxObjectNumber(). If one of them is fulfilled, the k-d tree recursive creation stops. See my TM's report for further information on this data structure.
| kdMaxDepth | The new maximum number of recursive steps of the k-d tree. |
| void Scene::setKDMaxObjectNumber | ( | unsigned int | kdMaxObjectNumber | ) |
Setter for the maximum number of objects in a k-d tree leaf.
One of the two recursion stop conditions, along with Scene::setKDMaxDepth(). If one of them is fulfilled, the k-d tree recursive creation stops. See my TM's report for further information on this data structure.
| kdMaxObjectNumber | The new maximum number of objects in a k-d tree leaf. |
| void Scene::setKDTree | ( | bool | kdTree | ) |
Setter for the k-d tree.
See my TM's report for further information on this data structure.
| kdTree | Whether a k-d tree will be used during the render. |
| void Scene::setLeastRenderTime4PictureBackup | ( | double | leastRenderTime4PictureBackup | ) |
Setter for the least render time after which the picture is backed up.
If this value is set to 0.0, the picture will always be backed up after the render.
| leastRenderTime4PictureBackup | The new least render time after which the picture is backed up. |
| void Scene::setMinBounces | ( | unsigned int | minBounces | ) |
Setter for the minimum number of bounces.
| minBounces | The new minimum number of bounces that will be used during the render. |
| void Scene::setNextEventEstimation | ( | bool | nextEventEstimation | ) |
Setter for the next event estimation.
See my TM's report for further information on this algorithm.
| nextEventEstimation | Whether the next event estimation algorithm will be used during the render. |
| void Scene::setNumberThreads | ( | unsigned int | numberThreads | ) |
Setter for the number of CPU threads.
| numberThreads | The new number of threads that will be used on the CPU during the render. |
| void Scene::setObjectGroups | ( | std::vector< Object3DGroup > | groups | ) |
Setter for the object groups.
| groups | The new object groups of this scene. |
| void Scene::setRrStopProbability | ( | double | rrStopProbability | ) |
Setter for the russian roulette stop probability.
See my TM's report for further information on this algorithm.
| rrStopProbability | The new russian roulette stop probability that will be used during the render. |
| void Scene::setRussianRoulette | ( | bool | russianRoulette | ) |
Setter for the russian roulette.
See my TM's report for further information on this algorithm.
| russianRoulette | Whether the russian roulette path termination algorithm will be used during the render. |
| void Scene::setRussianRoulette | ( | bool | russianRoulette, |
| double | rrStopProbability | ||
| ) |
Setter for the russian roulette and russian roulette stop probability.
See my TM's report for further information on this algorithm.
| russianRoulette | Whether the russian roulette path termination algorithm will be used during the render. |
| rrStopProbability | The new russian roulette stop probability that will be used during the render. |
| void Scene::setSamplesPerPixel | ( | unsigned int | samplesPerPixel | ) |
Setter for the number of samples per pixel.
| samplesPerPixel | The new number of samples per pixel that will be used during the render. |