Renderer coupled with a basic diffuse path tracer. The user can move the camera anywhere and trigger a path-traced rendering. Can also display the raycaster acceleration structure.
More...
#include <BVHRenderer.hpp>
|
|
Program * | _objectProgram |
| | Basic object program.
|
| |
|
Program * | _bvhProgram |
| | BVH visualisation program.
|
| |
|
std::vector< Mesh > | _bvhLevels |
| | The BVH visualisation mesh.
|
| |
|
std::vector< Mesh > | _rayLevels |
| | BVH nodes intersected with a ray.
|
| |
|
Mesh | _rayVis = Mesh("rayVis") |
| | Mesh representing a ray and its intersected triangle.
|
| |
|
std::shared_ptr< Scene > | _scene |
| | The scene to render.
|
| |
|
std::unique_ptr< RaycasterVisualisation > | _visuHelper |
| | Helper for raycaster internal data visualisation.
|
| |
|
glm::ivec2 | _bvhRange = glm::ivec2(0, 1) |
| | The subset of the BVH to display.
|
| |
|
bool | _showBVH = true |
| | Show the raytracer BVH.
|
| |
|
|
std::string | _name |
| | Debug name.
|
| |
|
Layout | _colorFormat = Layout::NONE |
| | The preferred output format for a given renderer.
|
| |
|
Layout | _depthFormat = Layout::NONE |
| | The preferred output format for a given renderer.
|
| |
Renderer coupled with a basic diffuse path tracer. The user can move the camera anywhere and trigger a path-traced rendering. Can also display the raycaster acceleration structure.
Inherits Renderer.
◆ BVHRenderer()
| BVHRenderer::BVHRenderer |
( |
| ) |
|
|
explicit |
◆ ~BVHRenderer()
| BVHRenderer::~BVHRenderer |
( |
| ) |
|
|
override |
◆ castRay()
| void BVHRenderer::castRay |
( |
const glm::vec3 & |
position, |
|
|
const glm::vec3 & |
direction |
|
) |
| |
Generate visualisation for a ray cast from a position.
- Parameters
-
| position | the ray origin. |
| direction | the ray direction. |
◆ clearRay()
| void BVHRenderer::clearRay |
( |
| ) |
|
Delete the displayed ray.
◆ draw()
| void BVHRenderer::draw |
( |
const Camera & |
camera, |
|
|
Texture * |
dstColor, |
|
|
Texture * |
dstDepth, |
|
|
uint |
layer = 0 |
|
) |
| |
|
overridevirtual |
Draw from a given viewpoint.
- Parameters
-
| camera | the rendering viewpoint |
| dstColor | the destination color texture (optional, see outputColorFormat) |
| dstDepth | the destination depth texture (optional, see outputDepthFormat) |
| layer | the layer to write to in the target |
Reimplemented from Renderer.
◆ maxLevel()
| int BVHRenderer::maxLevel |
( |
| ) |
|
The maximum depth of the BVH.
- Returns
- the maximum level
◆ range()
| glm::ivec2 & BVHRenderer::range |
( |
| ) |
|
|
inline |
Display a range of levels of the BVH.
- Returns
- the range
◆ setScene()
| void BVHRenderer::setScene |
( |
const std::shared_ptr< Scene > & |
scene, |
|
|
const Raycaster & |
raycaster |
|
) |
| |
Set the scene to render.
- Parameters
-
| scene | the new scene |
| raycaster | the associated raycaster |
◆ showBVH()
| bool & BVHRenderer::showBVH |
( |
| ) |
|
|
inline |
Show the BVH structure.
- Returns
- the toggle
The documentation for this class was generated from the following files: