MobileRT
1.0
A multi platform C++ CPU progressive Ray Tracer.
|
#include <Renderer.hpp>
Public Member Functions | |
Renderer ()=delete | |
Renderer (::std::unique_ptr< Shader > shader, ::std::unique_ptr< Camera > camera, ::std::unique_ptr< Sampler > samplerPixel, ::std::int32_t width, ::std::int32_t height, ::std::int32_t samplesPixel) | |
Renderer (const Renderer &renderer)=delete | |
Renderer (Renderer &&renderer) noexcept=delete | |
~Renderer ()=default | |
Renderer & | operator= (const Renderer &renderer)=delete |
Renderer & | operator= (Renderer &&renderer) noexcept=delete |
void | renderFrame (::std::int32_t *bitmap, ::std::int32_t numThreads) |
void | stopRender () |
::std::int32_t | getSample () const |
::std::uint64_t | getTotalCastedRays () const |
Public Attributes | |
::std::unique_ptr< Camera > | camera_ {} |
::std::unique_ptr< Shader > | shader_ {} |
Private Member Functions | |
void | renderScene (::std::int32_t *bitmap, ::std::int32_t tid) |
float | getTile (::std::int32_t sample) |
Private Attributes | |
::std::unique_ptr< Sampler > | samplerPixel_ {} |
::std::int32_t | blockSizeX_ {} |
::std::int32_t | blockSizeY_ {} |
::std::int32_t | sample_ {} |
const ::std::int32_t | width_ {} |
const ::std::int32_t | height_ {} |
const ::std::int32_t | domainSize_ {} |
const ::std::int32_t | resolution_ {} |
::std::int32_t | samplesPixel_ {} |
::std::atomic<::std::int32_t > | block_ {} |
The main class of the Ray Tracer engine. After setup this object, it provides methods to start and stop the rendering process of a scene.
|
explicitdelete |
|
explicit |
|
delete |
|
deletenoexcept |
|
default |
std::int32_t Renderer::getSample | ( | ) | const |
Gets the number of samples per pixel already rendered.
|
private |
Helper method which calculates a random value between 0 and 1.
This method never repeats the calculated value for the same given sample.
sample | The current sample of samples per pixel. |
std::uint64_t Renderer::getTotalCastedRays | ( | ) | const |
Helper method that calculates the total number of casted rays in the scene.
void Renderer::renderFrame | ( | ::std::int32_t * | bitmap, |
::std::int32_t | numThreads | ||
) |
Starts the rendering process of the scene into a bitmap.
bitmap | The bitmap where the rendered scene should be put. |
numThreads | The number of threads to use during the rendering process. |
|
private |
Helper method which a thread renders the scene into the bitmap.
bitmap | The bitmap where the rendered scene should be put. |
tid | The thread id. |
void Renderer::stopRender | ( | ) |
Stops the rendering process.
|
private |
|
private |
|
private |
::std::unique_ptr<Camera> MobileRT::Renderer::camera_ {} |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
::std::unique_ptr<Shader> MobileRT::Renderer::shader_ {} |
|
private |