42 #include <mesh_utils.h> 50 #define MAXIMUM_INVERSION_ERROR 1.0e-6f 52 #define TRANSFORM_PDF(_p, _w, _w_norm) (_p *= _w_norm / _w) 61 enum ComponentSelectionStrategy
63 kWeightedComponentSelection = 0,
64 kUniformComponentSelection = 1,
65 kPdfComponentSelection = 3,
66 kWeightedPdfComponentSelection = 4,
67 kBrdfComponentSelection = 5,
72 kDirectTransformPdf = 0,
73 kInverseTransformPdf = 1,
78 DR = Bsdf::kDiffuseReflectionIndex,
79 DT = Bsdf::kDiffuseTransmissionIndex,
80 GR = Bsdf::kGlossyReflectionIndex,
81 GT = Bsdf::kGlossyTransmissionIndex,
89 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
91 ComponentSelectionStrategy _strategy,
96 const bool _RR =
false);
100 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
105 template <
typename TRandomGenerator>
106 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
114 BsdfInverse::PdfType pdf_type = BsdfInverse::kDirectTransformPdf,
116 float* p_proj = NULL);
120 template <
typename TRandomGenerator>
121 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
128 TRandomGenerator& random,
130 const bool output_global_coordinates =
true);
138 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
142 const bool weighted =
false)
const;
146 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
152 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
157 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
158 bool precompute_component_selection_coefficients();
160 ComponentSelectionStrategy strategy;
163 float p_comp_proj[4];
169 template <
typename TRandomGenerator,
typename BsdfComponent>
170 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
172 const BsdfComponent& bsdf_comp,
182 if (bsdf_comp.invert(
212 const float err = 1.0f - dot(out_, out);
213 if (err > MAXIMUM_INVERSION_ERROR)
225 if (!cugar::is_finite(g_.x) ||
226 !cugar::is_finite(g_.y) ||
227 !cugar::is_finite(g_.z))
233 template <
typename TRandomGenerator>
234 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
247 float diffuse_refl_prob;
248 float diffuse_trans_prob;
249 float glossy_refl_prob;
250 float glossy_trans_prob;
252 bsdf.
sampling_weights(v_prev, in, diffuse_refl_prob, diffuse_trans_prob, glossy_refl_prob, glossy_trans_prob);
254 float w1 = diffuse_refl_prob;
255 float w2 = glossy_refl_prob;
256 float w3 = diffuse_trans_prob;
257 float w4 = glossy_trans_prob;
258 const float w_sum = w1 + w2 + w3 + w4;
260 const float w1_norm = w1 / w_sum;
261 const float w2_norm = w2 / w_sum;
262 const float w3_norm = w3 / w_sum;
263 const float w4_norm = w4 / w_sum;
273 const float v =
random.next();
291 else if (v < w1_norm + w2_norm)
308 else if (v < w1_norm + w2_norm + w3_norm)
323 z.z = z.z * w3 + w1 + w2;
340 z.z = z.z * w4 + w1 + w2 + w3;
348 p += w1 * bsdf.
diffuse().
p(v_prev, in, out, cugar::kSolidAngle);
349 p_proj += w1 * bsdf.
diffuse().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
352 p += w2 * bsdf.
glossy().
p(v_prev, in, out, cugar::kSolidAngle);
353 p_proj += w2 * bsdf.
glossy().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
356 p += w3 * bsdf.
diffuse_trans().
p(v_prev, in, out, cugar::kSolidAngle);
357 p_proj += w3 * bsdf.
diffuse_trans().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
360 p += w4 * bsdf.
glossy_trans().
p(v_prev, in, out, cugar::kSolidAngle);
361 p_proj += w4 * bsdf.
glossy_trans().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
364 p = 1.0f / cugar::max( p, 1.0e-8f );
365 p_proj = 1.0f / cugar::max( p_proj, 1.0e-8f );
370 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
372 ComponentSelectionStrategy _strategy,
380 strategy = _strategy;
388 const float w_sum = w[0] + w[1] + w[2] + w[3];
390 for (uint32 i = 0; i < 4; ++i)
395 p_comp[DR] = bsdf.
diffuse().
p(geom, in, out, cugar::kSolidAngle);
396 p_comp_proj[DR] = bsdf.
diffuse().
p(geom, in, out, cugar::kProjectedSolidAngle);
399 p_comp[GR] = bsdf.
glossy().
p(geom, in, out, cugar::kSolidAngle);
400 p_comp_proj[GR] = bsdf.
glossy().
p(geom, in, out, cugar::kProjectedSolidAngle);
403 p_comp[DT] = bsdf.
diffuse_trans().
p(geom, in, out, cugar::kSolidAngle);
404 p_comp_proj[DT] = bsdf.
diffuse_trans().
p(geom, in, out, cugar::kProjectedSolidAngle);
407 p_comp[GT] = bsdf.
glossy_trans().
p(geom, in, out, cugar::kSolidAngle);
408 p_comp_proj[GT] = bsdf.
glossy_trans().
p(geom, in, out, cugar::kProjectedSolidAngle);
410 if (strategy == BsdfInverse::kBrdfComponentSelection)
413 bsdf.
f( geom, in, out, f_comp );
416 precompute_component_selection_coefficients();
419 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
420 bool BsdfInverse::precompute_component_selection_coefficients()
422 if (strategy == BsdfInverse::kUniformComponentSelection)
424 for (uint32 i = 0; i < 4; ++i)
427 else if (strategy == BsdfInverse::kWeightedComponentSelection)
429 for (uint32 i = 0; i < 4; ++i)
432 else if (strategy == BsdfInverse::kPdfComponentSelection)
434 for (uint32 i = 0; i < 4; ++i)
435 p_sel[i] = p_comp_proj[i];
437 else if (strategy == BsdfInverse::kWeightedPdfComponentSelection)
439 for (uint32 i = 0; i < 4; ++i)
440 p_sel[i] = w[i] * p_comp_proj[i];
442 else if (strategy == BsdfInverse::kBrdfComponentSelection)
444 for (uint32 i = 0; i < 4; ++i)
445 p_sel[i] = w[i] == 0 ? 0.0f : cugar::max_comp( f_comp[i] ) ;
449 const float p_sel_sum = p_sel[0] + p_sel[1] + p_sel[2] + p_sel[3];
453 for (uint32 i = 0; i < 4; ++i)
454 p_sel[i] /= p_sel_sum;
463 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
467 v < p_sel[DR] ? Bsdf::kDiffuseReflection :
468 v < p_sel[DR] + p_sel[GR] ? Bsdf::kGlossyReflection :
469 v < p_sel[DR] + p_sel[GR] + p_sel[DT] ? Bsdf::kDiffuseTransmission :
470 Bsdf::kGlossyTransmission;
473 template <
typename TRandomGenerator>
474 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
482 BsdfInverse::PdfType pdf_type,
487 if (!cugar::is_finite(p_comp_proj[0]) ||
488 !cugar::is_finite(p_comp_proj[1]) ||
489 !cugar::is_finite(p_comp_proj[2]) ||
490 !cugar::is_finite(p_comp_proj[3]))
498 for (uint32 i = 0; i < 4; ++i)
500 *p += w[i] * p_comp[i];
501 *p_proj += w[i] * p_comp_proj[i];
504 if (pdf_type == BsdfInverse::kInverseTransformPdf)
507 *p = 1.0f / cugar::max( *p, 1.0e-8f );
508 *p_proj = 1.0f / cugar::max( *p_proj, 1.0e-8f );
512 const float v = random.next();
519 template <
typename TRandomGenerator>
520 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
529 const bool output_global_coordinates)
532 float inv_p_comp_proj;
534 if (out_comp == Bsdf::kDiffuseReflection)
545 inv_p_comp_proj) ==
false)
551 if (output_global_coordinates)
557 else if (out_comp == Bsdf::kGlossyReflection)
568 inv_p_comp_proj) ==
false)
574 if (output_global_coordinates)
577 z.z = z.z * w[GR] + w[DR];
580 else if (out_comp == Bsdf::kDiffuseTransmission)
591 inv_p_comp_proj) ==
false)
597 if (output_global_coordinates)
600 z.z = z.z * w[DT] + w[GR] + w[DR];
614 inv_p_comp_proj) ==
false)
620 if (output_global_coordinates)
623 z.z = z.z * w[GT] + w[DT] + w[GR] + w[DR];
635 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
639 const bool weighted)
const 642 (out_comp == Bsdf::kDiffuseReflection) ? (weighted ? w[DR] : 1.0f) * (measure == cugar::kSolidAngle ? p_comp[DR] : p_comp_proj[DR]) :
643 (out_comp == Bsdf::kGlossyReflection) ? (weighted ? w[GR] : 1.0f) * (measure == cugar::kSolidAngle ? p_comp[GR] : p_comp_proj[GR]) :
644 (out_comp == Bsdf::kDiffuseTransmission) ? (weighted ? w[DT] : 1.0f) * (measure == cugar::kSolidAngle ? p_comp[DT] : p_comp_proj[DT]) :
645 (weighted ? w[GT] : 1.0f) * (measure == cugar::kSolidAngle ? p_comp[GT] : p_comp_proj[GT]);
650 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
655 (out_comp == Bsdf::kDiffuseReflection) ? p_sel[DR] :
656 (out_comp == Bsdf::kGlossyReflection) ? p_sel[GR] :
657 (out_comp == Bsdf::kDiffuseTransmission) ? p_sel[DT] :
663 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
668 (out_comp == Bsdf::kDiffuseReflection) ? w[DR] :
669 (out_comp == Bsdf::kGlossyReflection) ? w[GR] :
670 (out_comp == Bsdf::kDiffuseTransmission) ? w[DT] :
674 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
685 float diffuse_refl_prob;
686 float diffuse_trans_prob;
687 float glossy_refl_prob;
688 float glossy_trans_prob;
690 bsdf.
sampling_weights(v_prev, in, diffuse_refl_prob, diffuse_trans_prob, glossy_refl_prob, glossy_trans_prob);
698 p1 = bsdf.
diffuse().
p(v_prev, in, out, cugar::kSolidAngle);
699 p1_proj = bsdf.
diffuse().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
701 p1 *= diffuse_refl_prob;
702 p1_proj *= diffuse_refl_prob;
705 p2 = bsdf.
glossy().
p(v_prev, in, out, cugar::kSolidAngle);
706 p2_proj = bsdf.
glossy().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
708 p2 *= glossy_refl_prob;
709 p2_proj *= glossy_refl_prob;
713 p3_proj = bsdf.
diffuse_trans().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
715 p3 *= diffuse_trans_prob;
716 p3_proj *= diffuse_trans_prob;
719 p4 = bsdf.
glossy_trans().
p(v_prev, in, out, cugar::kSolidAngle);
720 p4_proj = bsdf.
glossy_trans().
p(v_prev, in, out, cugar::kProjectedSolidAngle);
722 p4 *= glossy_trans_prob;
723 p4_proj *= glossy_trans_prob;
725 p = 1.0f / (p1 + p2 + p3 + p4);
726 p_proj = 1.0f / (p1_proj + p2_proj + p3_proj + p4_proj);
729 template <
typename PathType,
typename TRandomGenerator>
730 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
731 bool invert_eye_subpath(
const PathType& path,
const uint32 t,
const uint32 t_ext,
float* out_Z,
float* out_pdf,
const RenderingContextView& renderer, TRandomGenerator&
random)
754 in = cugar::normalize(
cugar::Vector3f(renderer.camera.eye) - v_prev.position);
761 in = cugar::normalize(p_prev2 - v_prev.position);
767 for (uint32 i = t; i < t_ext; ++i)
780 const int material_id = renderer.mesh.material_indices[path.v_E(i-1).prim_id];
781 MeshMaterial material = renderer.mesh.materials[material_id];
784 material.diffuse *= texture_lookup(v_prev.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
785 material.specular *= texture_lookup(v_prev.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
786 material.emissive *= texture_lookup(v_prev.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
788 Bsdf bsdf(kRadianceTransport, renderer, material);
793 const float d2 = cugar::max( cugar::square_length(out), 1.0e-8f );
813 out_Z[(i - t) * 3 + 0] = z.x;
814 out_Z[(i - t) * 3 + 1] = z.y;
815 out_Z[(i - t) * 3 + 2] = z.z;
818 *out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
828 template <
typename PathType>
829 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
830 float eye_subpath_inversion_pdf(
const PathType& path,
const uint32 t,
const uint32 t_ext,
const float* out_Z,
const RenderingContextView& renderer)
832 FERMAT_ASSERT(t >= 2);
833 FERMAT_ASSERT(t_ext <= path.n_vertices);
838 float out_pdf = 1.0f;
856 in = cugar::normalize(
cugar::Vector3f(renderer.camera.eye) - v_prev.position);
863 in = cugar::normalize(p_prev2 - v_prev.position);
869 for (uint32 i = t; i < t_ext; ++i)
882 const int material_id = renderer.mesh.material_indices[path.v_E(i - 1).prim_id];
883 MeshMaterial material = renderer.mesh.materials[material_id];
886 material.diffuse *= texture_lookup(v_prev.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
887 material.specular *= texture_lookup(v_prev.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
888 material.emissive *= texture_lookup(v_prev.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
890 Bsdf bsdf(kRadianceTransport, renderer, material);
895 const float d2 = cugar::max(cugar::square_length(out), 1.0e-8f);
904 z.x = out_Z[(i - t) * 3 + 0];
905 z.y = out_Z[(i - t) * 3 + 1];
906 z.z = out_Z[(i - t) * 3 + 2];
918 out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
928 template <
typename PathType,
typename TRandomGenerator>
929 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
930 bool invert_light_subpath(
const PathType& path,
const uint32 s,
const uint32 s_ext,
float* out_Z,
float* out_pdf,
const RenderingContextView& renderer, TRandomGenerator&
random)
932 FERMAT_ASSERT(s_ext <= path.n_vertices);
941 float z[3] = { random.next(), random.next(), random.next() };
944 if (renderer.mesh_light.
invert_impl(path.v_L(0).prim_id, path.v_L(0).uv, z, out_Z, out_pdf) ==
false)
964 in = cugar::normalize(p_prev2 - v_prev.position);
968 if (s <= 1 && s_ext >= 2)
982 const int material_id = renderer.mesh.material_indices[path.v_L(0).prim_id];
983 MeshMaterial material = renderer.mesh.materials[material_id];
991 const float d2 = cugar::max(cugar::square_length(out), 1.0e-8f);
1009 out_Z[(1 - s) * 3 + 0] = z.x;
1010 out_Z[(1 - s) * 3 + 1] = z.y;
1011 out_Z[(1 - s) * 3 + 2] = z.z;
1014 *out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
1022 for (uint32 i = cugar::max( s, 2u ); i < s_ext; ++i)
1024 FERMAT_ASSERT(path.v_L(i).prim_id < renderer.mesh.num_triangles);
1036 FERMAT_ASSERT(path.v_L(i - 1).prim_id < renderer.mesh.num_triangles);
1037 const int material_id = renderer.mesh.material_indices[path.v_L(i - 1).prim_id];
1038 FERMAT_ASSERT(material_id >= 0 && material_id < renderer.mesh.num_materials);
1039 MeshMaterial material = renderer.mesh.materials[material_id];
1042 material.diffuse *= texture_lookup(v_prev.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
1043 material.specular *= texture_lookup(v_prev.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
1044 material.emissive *= texture_lookup(v_prev.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
1046 Bsdf bsdf(kParticleTransport, renderer, material);
1051 const float d2 = cugar::max(cugar::square_length(out), 1.0e-8f);
1071 out_Z[(i - s) * 3 + 0] = z.x;
1072 out_Z[(i - s) * 3 + 1] = z.y;
1073 out_Z[(i - s) * 3 + 2] = z.z;
1076 *out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
1086 template <
typename PathType>
1087 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
1088 float light_subpath_inversion_pdf(
const PathType& path,
const uint32 s,
const uint32 s_ext,
const float* out_Z,
const RenderingContextView& renderer)
1090 FERMAT_ASSERT(s_ext <= path.n_vertices);
1095 float out_pdf = 1.0f;
1100 out_pdf = renderer.mesh_light.
inverse_pdf_impl(path.v_L(0).prim_id, path.v_L(0).uv, out_Z);
1119 in = cugar::normalize(p_prev2 - v_prev.position);
1123 if (s <= 1 && s_ext >= 2)
1137 const int material_id = renderer.mesh.material_indices[path.v_L(0).prim_id];
1138 MeshMaterial material = renderer.mesh.materials[material_id];
1146 const float d2 = cugar::max(cugar::square_length(out), 1.0e-8f);
1155 z.x = out_Z[(1 - s) * 3 + 0];
1156 z.y = out_Z[(1 - s) * 3 + 1];
1157 z.z = out_Z[(1 - s) * 3 + 2];
1168 out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
1176 for (uint32 i = cugar::max(s, 2u); i < s_ext; ++i)
1189 const int material_id = renderer.mesh.material_indices[path.v_L(i - 1).prim_id];
1190 MeshMaterial material = renderer.mesh.materials[material_id];
1193 material.diffuse *= texture_lookup(v_prev.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
1194 material.specular *= texture_lookup(v_prev.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
1195 material.emissive *= texture_lookup(v_prev.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
1197 Bsdf bsdf(kParticleTransport, renderer, material);
1202 const float d2 = cugar::max(cugar::square_length(out), 1.0e-8f);
1211 z.x = out_Z[(i - s) * 3 + 0];
1212 z.y = out_Z[(i - s) * 3 + 1];
1213 z.z = out_Z[(i - s) * 3 + 2];
1225 out_pdf *= p_proj * d2 / cugar::max(fabsf(dot(v_prev.normal_s, out)*dot(v.normal_s, out)), 1.0e-8f);
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float p(const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const SphericalMeasure measure=kProjectedSolidAngle) const
Definition: lambert_trans.h:103
SphericalMeasure
Definition: differential_geometry.h:50
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float pdf(const Bsdf::ComponentType out_comp, cugar::SphericalMeasure measure=cugar::kProjectedSolidAngle, const bool weighted=false) const
Definition: path_inversion.h:636
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float p(const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const SphericalMeasure measure=kProjectedSolidAngle) const
Definition: ggx_smith.h:484
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float pdf_comp(const Bsdf::ComponentType out_comp) const
Definition: path_inversion.h:651
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float weight(const Bsdf::ComponentType out_comp) const
Definition: path_inversion.h:664
FERMAT_HOST_DEVICE const glossy_component & glossy_trans() const
Definition: bsdf.h:293
ComponentType
Definition: bsdf.h:139
Definition: MeshView.h:55
FERMAT_HOST_DEVICE const diffuse_component & diffuse() const
Definition: bsdf.h:283
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE Bsdf::ComponentType sample_component(const float v) const
Definition: path_inversion.h:464
FERMAT_HOST_DEVICE const diffuse_trans_component & diffuse_trans() const
Definition: bsdf.h:278
FERMAT_HOST_DEVICE void setup_differential_geometry(const MeshView &mesh, const uint32 tri_id, const float u, const float v, VertexGeometry *geom, float *pdf=0)
Definition: mesh_utils.h:185
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool invert(const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, RandomGeneratorT &random, Vector3f &z, float &p, float &p_proj) const
Definition: lambert_edf.h:113
float random()
Definition: tiled_sampling.h:44
Definition: path_inversion.h:59
FERMAT_HOST_DEVICE float inverse_pdf_impl(const uint32_t prim_id, const cugar::Vector2f &uv, const float *out_Z) const
Definition: lights.h:465
FERMAT_HOST_DEVICE bool invert_impl(const uint32_t prim_id, const cugar::Vector2f &uv, const float *in_Z, float *out_Z, float *out_pdf) const
Definition: lights.h:436
FERMAT_FORCEINLINE FERMAT_HOST_DEVICE void sampling_weights(const cugar::DifferentialGeometry &geometry, const cugar::Vector3f V, float &diffuse_refl_prob, float &diffuse_trans_prob, float &glossy_refl_prob, float &glossy_trans_prob) const
Definition: bsdf.h:530
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void inverse_pdf(const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const Vector3f u, float &p, float &p_proj) const
Definition: lambert_edf.h:143
FERMAT_HOST_DEVICE cugar::Vector3f interpolate_position(const MeshView &mesh, const uint32 tri_id, const float u, const float v, float *pdf=0)
Definition: mesh_utils.h:323
FERMAT_FORCEINLINE FERMAT_HOST_DEVICE cugar::Vector3f f(const cugar::DifferentialGeometry &geometry, const cugar::Vector3f w_i, const cugar::Vector3f w_o, const ComponentType components=kAllComponents) const
Definition: bsdf.h:312
Definition: renderer_view.h:80
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE bool invert_component(const Bsdf &bsdf, const VertexGeometry &geom, const cugar::Vector3f &in, const cugar::Vector3f &out, const Bsdf::ComponentType out_comp, TRandomGenerator &random, cugar::Vector3f &z, const bool output_global_coordinates=true)
Definition: path_inversion.h:521
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float p(const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const SphericalMeasure measure=kProjectedSolidAngle) const
Definition: lambert.h:116
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE void setup(ComponentSelectionStrategy _strategy, const Bsdf &bsdf, const VertexGeometry &geom, const cugar::Vector3f &in, const cugar::Vector3f &out, const bool _RR=false)
Definition: path_inversion.h:371
FERMAT_HOST_DEVICE const glossy_component & glossy() const
Definition: bsdf.h:288
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE bool invert(const Bsdf &bsdf, const VertexGeometry &geom, const cugar::Vector3f &in, const cugar::Vector3f &out, TRandomGenerator &random, cugar::Vector3f &z, BsdfInverse::PdfType pdf_type=BsdfInverse::kDirectTransformPdf, float *p=NULL, float *p_proj=NULL)
Definition: path_inversion.h:475