![]() |
Dandelion 2.0.0
A light-weight 3D builder for educational usage
|
实现 Whitted-Style 光线追踪管线。 更多...
#include <render_engine.h>
Public 成员函数 | |
| WhittedRenderer (RenderEngine &engine) | |
| void | render (Scene &scene) |
Public 属性 | |
| float & | width |
| float & | height |
| int & | n_threads |
| bool | use_bvh |
| std::vector< unsigned char > & | rendering_res |
静态 Public 属性 | |
| static constexpr float | mirror_threshold = 1000.0f |
Private 成员函数 | |
| float | fresnel (const Eigen::Vector3f &I, const Eigen::Vector3f &N, const float &ior) |
| 菲涅尔方程根据观察角度计算反射光线的所占百分比 | |
| std::optional< std::tuple< Intersection, PhongMaterial > > | trace (const Ray &ray, const Scene &scene) |
| 追踪光线与场景中物体的相交情况 | |
| Eigen::Vector3f | cast_ray (const Ray &ray, const Scene &scene, int depth) |
| 追踪指定光线得到颜色 | |
Private 属性 | |
| std::shared_ptr< spdlog::logger > | logger |
实现 Whitted-Style 光线追踪管线。
追踪指定光线得到颜色
| ray | 当前追踪的光线 |
| scene | 当前渲染的场景 |
| depth | 最大反射次数 |
|
private |
菲涅尔方程根据观察角度计算反射光线的所占百分比
| I | 入射光方向 |
| N | 法线向量 |
| ior | 当前反射介质的折射率 |
| void WhittedRenderer::render | ( | Scene & | scene | ) |
whitted-style 渲染器的渲染调用接口
|
private |
|
staticconstexpr |
镜面反射的阈值
| bool WhittedRenderer::use_bvh |
是否使用 BVH 进行加速