#include <renderer.h>
Public Member Functions | |
| Renderer () | |
| virtual | ~Renderer () |
| void | SetScene (const Scene *scene) |
| Sets the scene to render. | |
| void | SetCamera (const ICamera *camera) |
| Sets the camera. | |
| void | SetGlobalPhotonMap (const PhotonMap *global_pm) |
| Sets the global photon map. | |
| void | SetCausticsPhotonMap (const PhotonMap *cautics_pm) |
| Sets the caustics photon map. | |
| void | SetFramebuffer (Framebuffer *framebuffer) |
| Sets the framebuffer and resets the render area. | |
| void | SetRenderArea (int x0, int y0, int x1, int y1) |
| void | ResetRenderArea () |
| Sets the render area to the full frame. | |
| void | Restart (const Context &context) |
| void | RenderNextPixel (const Context &context) |
| Renders the next pixel. Does nothing if there is no more pixel to render. | |
| bool | IsRenderComplete () const |
| Methods for progress report. | |
| int | GetCompletedLines () const |
| sheep::Real | GetProgress () const |
| void | Annotate (const Context &context) |
Private Member Functions | |
| void | cleanup () |
| void | render_pixel (const Context &context) |
| void | render_pixel_supersampling (const Context &context) |
| void | render_pixel_whitted (const Context &context) |
| Color3 | whitted_recursive_sampling (const Context &context, const sheep::Point2 ¢er, const sheep::Point2 &v0, const sheep::Point2 &v1, const sheep::Point2 &v2, const sheep::Point2 &v3, const Color3 &r0, const Color3 &r1, const Color3 &r2, const Color3 &r3, int recursion_level) |
| Color3 | trace (const Context &context, const Ray &ray, int recursion_level) |
| Color3 | compute_direct_illumination (const Context &context, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const sheep::Vector3 &outgoing, const ISurfaceShader *surface_shader, const ShadingData &shadingdata) |
| Color3 | compute_specular_reflections (const Context &context, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const sheep::Vector3 &outgoing, const ShadingData &shadingdata, int recursion_level) |
| The returned value is a radiance (W.m^-2.sr^-1). | |
| Color3 | final_gathering (const Context &context, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const sheep::Vector3 &outgoing, const ShadingData &shadingdata, bool is_secondary=false) const |
| The returned value is a radiance (W.m^-2.sr^-1). | |
| Color3 | compute_caustics (const Context &context, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const sheep::Vector3 &outgoing, const ShadingData &shadingdata) const |
| The returned value is a radiance (W.m^-2.sr^-1). | |
| Color3 | compute_indirect_illumination (const Context &context, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const sheep::Vector3 &outgoing, const ShadingData &shadingdata) const |
Private Attributes | |
| const Scene * | m_scene |
| const ICamera * | m_camera |
| const PhotonMap * | m_global_pm |
| const PhotonMap * | m_caustics_pm |
| Framebuffer * | m_framebuffer |
| int | m_area_x0 |
| int | m_area_y0 |
| Top-left corner of the render area. | |
| int | m_area_x1 |
| int | m_area_y1 |
| Bottom-right corner of the render area. | |
| int | m_x |
| int | m_y |
| Coordinates of the next pixel to render. | |
| int | m_completed_pixels |
| Number of rendered pixels until now. | |
| int | m_area_pixels |
| Number of pixels contained in the render area. | |
| sheep::Real | m_inv_area_pixels |
| m_inv_area_pixels = 1.0 / m_area_pixels. | |
| ISurfaceSampler * | m_pixel_ss |
| Pixel surface sampler. | |
| ISurfaceSampler * | m_arealight_ss |
| Area light surface sampler. | |
| ISurfaceSampler * | m_primary_fg_hss |
| Hemisphere surface sampler when doing primary final gathering. | |
| ISurfaceSampler * | m_secondary_fg_hss |
| Hemisphere surface sampler when doing secondary final gathering. | |
| ILight::IrradianceSampleVector | m_irradiance_samples |
| Irradiance samples (area light sampling). | |
| Color3 * | m_prev_pixels |
|
|
Definition at line 49 of file renderer.cpp. References ENABLE_WHITTED_SAMPLING_CACHE. |
|
|
Definition at line 65 of file renderer.cpp. References cleanup(). |
|
|
Definition at line 220 of file renderer.cpp. References toxic::IObject::Annotate(), and toxic::Scene::GetRootObject(). |
|
|
Definition at line 224 of file renderer.cpp. References m_arealight_ss, m_pixel_ss, m_prev_pixels, m_primary_fg_hss, and m_secondary_fg_hss. Referenced by Restart(), and ~Renderer(). |
|
||||||||||||||||||||||||||||
|
The returned value is a radiance (W.m^-2.sr^-1).
Definition at line 819 of file renderer.cpp. References toxic::PhotonMap::ComputeRadiance(), toxic::IBDF::IsDiffuse(), sheep::Vector3::IsUnitLength(), toxic::ShadingData::m_bdf, toxic::Settings::Rendering::Components::m_caustics, m_caustics_pm, toxic::Settings::Rendering::m_components, toxic::Settings::RadianceEstimateSettings::m_max_distance, toxic::Settings::RadianceEstimateSettings::m_max_photons, toxic::Settings::Rendering::Components::Caustics::m_radiance_est, toxic::Settings::m_rendering, and toxic::Context::m_settings. Referenced by trace(). |
|
||||||||||||||||||||||||||||||||
|
Computes the radiance reflected toward a given direction due to direct illumination of a given surface, at a given point. The point, the surface normal and the direction are expressed in world space. The direction is such as it leaves the surface, and is unit-length. The returned value is a radiance (W.m^-2.sr^-1).
Definition at line 586 of file renderer.cpp. References toxic::ILight::ComputeIrradiance(), toxic::IBDF::Evaluate(), toxic::ISurfaceSampler::GenerateNewSamples(), toxic::Scene::GetAmbientIllumination(), toxic::Scene::GetLight(), toxic::Scene::GetLightCount(), toxic::Color3::IsBlack(), toxic::IBDF::IsDiffuse(), sheep::Vector3::IsUnitLength(), m_arealight_ss, toxic::ShadingData::m_bdf, toxic::ILight::IrradianceSample::m_direction, toxic::ILight::IrradianceSample::m_irradiance, m_irradiance_samples, toxic::ShadingData::m_reflectance, toxic::ISurfaceSampler::m_samples, and toxic::SurfaceBasis::TransformToLocal(). Referenced by trace(). |
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
The returned value is a radiance (W.m^-2.sr^-1).
Definition at line 663 of file renderer.cpp. References toxic::IBDF::EvaluateSpecular(), toxic::Color3::IsBlack(), toxic::IBDF::IsSpecular(), sheep::Vector3::IsUnitLength(), toxic::ShadingData::m_bdf, toxic::Settings::Rendering::m_components, toxic::Settings::Rendering::Components::SpecularReflections::m_max_depth, toxic::ShadingData::m_reflectance, toxic::Settings::m_rendering, toxic::Context::m_settings, toxic::Settings::Rendering::Components::m_specular_reflections, trace(), toxic::SurfaceBasis::TransformToLocal(), and toxic::SurfaceBasis::TransformToWorld(). Referenced by trace(). |
|
||||||||||||||||||||||||||||||||
|
|
Definition at line 259 of file renderer.h. |
|
|
Definition at line 264 of file renderer.h. Referenced by main(). |
|
|
Methods for progress report.
Definition at line 252 of file renderer.h. Referenced by main(), and RenderNextPixel(). |
|
|
Computes the radiance passing through the current pixel and stores it into the framebuffer. Definition at line 235 of file renderer.cpp. References toxic::Settings::Rendering::PixelSampling::m_algorithm, toxic::Settings::Rendering::m_pixel_sampling, toxic::Settings::m_rendering, toxic::Context::m_settings, render_pixel_supersampling(), and render_pixel_whitted(). Referenced by RenderNextPixel(). |
|
|
|
Definition at line 291 of file renderer.cpp. References toxic::ICamera::ComputeRay(), toxic::Framebuffer::ConvertToNDC(), toxic::Framebuffer::GetPixelHeight(), toxic::Framebuffer::GetPixelWidth(), m_area_x0, m_area_y0, m_prev_pixels, sheep::Point2::m_x, m_x, sheep::Point2::m_y, m_y, toxic::Framebuffer::SetPixel(), trace(), and whitted_recursive_sampling(). Referenced by render_pixel(). |
|
|
Renders the next pixel. Does nothing if there is no more pixel to render.
Definition at line 199 of file renderer.cpp. References IsRenderComplete(), m_area_x0, m_area_x1, m_completed_pixels, toxic::Context::m_statistics, toxic::Statistics::m_total_pixels, m_x, m_y, and render_pixel(). Referenced by main(). |
|
|
Sets the render area to the full frame.
Definition at line 121 of file renderer.cpp. References toxic::Framebuffer::GetHeight(), toxic::Framebuffer::GetWidth(), m_area_x0, m_area_x1, m_area_y0, and m_area_y1. Referenced by SetFramebuffer(). |
|
|
|
Sets the camera.
Definition at line 74 of file renderer.cpp. Referenced by main(). |
|
|
Sets the caustics photon map.
Definition at line 84 of file renderer.cpp. References m_caustics_pm. Referenced by main(). |
|
|
Sets the framebuffer and resets the render area.
Definition at line 89 of file renderer.cpp. References ResetRenderArea(). Referenced by main(). |
|
|
Sets the global photon map.
Definition at line 79 of file renderer.cpp. References m_global_pm. Referenced by main(). |
|
||||||||||||||||||||
|
Sets the render area to the rectangle (x0, y0)-(x1, y1). (x0, y0) are the coordinates of the upper left corner of the render area. (x1, y1) are the coordinates of the lower right corner of the render area. The given rectangle is clipped against the framebuffer boundaries. The framebuffer must be set prior to calling this method.
Definition at line 96 of file renderer.cpp. References toxic::Framebuffer::GetHeight(), toxic::Framebuffer::GetWidth(), m_area_x0, m_area_x1, m_area_y0, and m_area_y1. Referenced by main(). |
|
|
Sets the scene to render.
Definition at line 69 of file renderer.cpp. Referenced by main(). |
|
||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Number of pixels contained in the render area.
Definition at line 118 of file renderer.h. Referenced by Restart(). |
|
|
Definition at line 111 of file renderer.h. Referenced by render_pixel_whitted(), RenderNextPixel(), ResetRenderArea(), Restart(), and SetRenderArea(). |
|
|
Definition at line 112 of file renderer.h. Referenced by RenderNextPixel(), ResetRenderArea(), Restart(), and SetRenderArea(). |
|
|
Top-left corner of the render area.
Definition at line 111 of file renderer.h. Referenced by render_pixel_whitted(), ResetRenderArea(), Restart(), and SetRenderArea(). |
|
|
Bottom-right corner of the render area.
Definition at line 112 of file renderer.h. Referenced by ResetRenderArea(), Restart(), and SetRenderArea(). |
|
|
Area light surface sampler.
Definition at line 123 of file renderer.h. Referenced by cleanup(), compute_direct_illumination(), and Restart(). |
|
|
Definition at line 96 of file renderer.h. |
|
|
Jensen: "The caustics photon map contains photons that have been reflected or transmitted via one specular surface before hitting a diffuse surface. In the path notation these are LS+D." Definition at line 107 of file renderer.h. Referenced by compute_caustics(), and SetCausticsPhotonMap(). |
|
|
Number of rendered pixels until now.
Definition at line 115 of file renderer.h. Referenced by RenderNextPixel(), and Restart(). |
|
|
Definition at line 109 of file renderer.h. |
|
|
Taken from Jensen's book: "The global photon map contains all photons that hit diffuse surfaces in the model. The photons in the global photon map represent direct illumination, indirect illumination, and caustics (in path notation: L(S|D)*D)." Definition at line 102 of file renderer.h. Referenced by compute_indirect_illumination(), and SetGlobalPhotonMap(). |
|
|
m_inv_area_pixels = 1.0 / m_area_pixels.
Definition at line 119 of file renderer.h. Referenced by Restart(). |
|
|
Irradiance samples (area light sampling).
Definition at line 128 of file renderer.h. Referenced by compute_direct_illumination(), and Restart(). |
|
|
Pixel surface sampler.
Definition at line 122 of file renderer.h. Referenced by cleanup(), render_pixel_supersampling(), and Restart(). |
|
|
Definition at line 131 of file renderer.h. Referenced by cleanup(), render_pixel_whitted(), and Restart(). |
|
|
Hemisphere surface sampler when doing primary final gathering.
Definition at line 124 of file renderer.h. Referenced by cleanup(), final_gathering(), and Restart(). |
|
|
Definition at line 95 of file renderer.h. |
|
|
Hemisphere surface sampler when doing secondary final gathering.
Definition at line 125 of file renderer.h. Referenced by cleanup(), final_gathering(), and Restart(). |
|
|
Definition at line 114 of file renderer.h. Referenced by render_pixel_supersampling(), render_pixel_whitted(), RenderNextPixel(), and Restart(). |
|
|
Coordinates of the next pixel to render.
Definition at line 114 of file renderer.h. Referenced by render_pixel_supersampling(), render_pixel_whitted(), RenderNextPixel(), and Restart(). |
1.3.6