37 #include <mesh_utils.h> 38 #include <cugar/linalg/vector.h> 40 #include <cugar/color/rgbe.h> 53 #define DEBUG_LENGTH 0 55 #define MIN_G_DENOM 1.0e-8f 57 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
58 float mis_selector(
const uint32 s,
const uint32 t,
const float w)
61 DEBUG_LENGTH ? (DEBUG_LENGTH == s + t - 1 ? w : 0.0f) :
62 (DEBUG_S == -1 && DEBUG_T == -1) ? w :
63 (DEBUG_S == s && DEBUG_T == t) ? 1.0f :
64 (DEBUG_S == s && DEBUG_T == -1) ? 1.0f :
65 (DEBUG_S == -1 && DEBUG_T == t) ? 1.0f :
69 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
72 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
73 float bpt_mis(
const float pGp,
const float prev_pGp,
const float next_pGp,
const float pGp_sum)
78 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
79 float bpt_mis(
const float pGp,
const float other_pGp,
const float pGp_sum)
84 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
85 float pdf_product(
const float p1,
const float p2)
88 cugar::is_finite(p1) &&
89 cugar::is_finite(p2) ? p1 * p2 : cugar::float_infinity();
92 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
93 float pdf_product(
const float p1,
const float p2,
const float p3)
96 cugar::is_finite(p1) &&
97 cugar::is_finite(p2) &&
98 cugar::is_finite(p3) ? p1 * p2 * p3 : cugar::float_infinity();
101 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
104 return (comp & Bsdf::kDiffuseMask) ? FBufferDesc::DIFFUSE_C : FBufferDesc::SPECULAR_C;
113 FERMAT_HOST_DEVICE
PathWeights(
const float _pGp_sum,
const float _pG) :
114 pGp_sum(_pGp_sum), pG(_pG) {}
115 FERMAT_HOST_DEVICE PathWeights(
const float2 f) : vector_storage(f) {}
117 FERMAT_HOST_DEVICE
operator float2()
const {
return vector_storage; }
120 float2 vector_storage;
135 pGp_sum(_weights.pGp_sum), pG(_weights.pG), out_p(_out_p), out_cos_theta(_out_cos_theta) {}
136 FERMAT_HOST_DEVICE TempPathWeights(
const float _pGp_sum,
const float _pG,
const float _out_p,
const float _out_cos_theta) :
137 pGp_sum(_pGp_sum), pG(_pG), out_p(_out_p), out_cos_theta(_out_cos_theta) {}
138 FERMAT_HOST_DEVICE TempPathWeights(
const float4 f) : vector_storage(f) {}
140 template <
typename EyeLightVertexType>
141 FERMAT_HOST_DEVICE TempPathWeights(
const EyeLightVertexType _v,
const cugar::Vector3f _out,
const float _out_p) :
145 out_cos_theta(fabsf(dot(_v.geom.normal_s, _out))) {}
149 static TempPathWeights eye_vertex_1(
const float p_e,
const float cos_theta_o,
const float light_tracing_weight)
151 return TempPathWeights(
154 light_tracing_weight ? p_e / light_tracing_weight : 1.0f,
155 light_tracing_weight ? cos_theta_o : 1.0e8f);
161 static TempPathWeights light_vertex_1(
const float p_A,
const float p_proj,
const float cos_theta_o)
163 return TempPathWeights(
171 FERMAT_HOST_DEVICE
operator float4()
const {
return vector_storage; }
174 float4 vector_storage;
188 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
192 cugar::to_rgbe(edf.color),
201 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
214 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
217 const uint32 roughness_i = (uint16)
cugar::quantize( material.roughness, 65535u );
218 const uint32 opacity_i = (uint16)
cugar::quantize( material.opacity, 255u );
219 const uint32 ior_i = (uint16)
cugar::quantize( material.index_of_refraction / 3.0f, 255u );
223 roughness_i | (opacity_i << 16) | (ior_i << 24),
230 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
233 return Edf(cugar::from_rgbe(packed_info.x));
239 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
242 const float roughness = (packed_info.z & 65535u) / 65535.0f;
243 const float opacity = ((packed_info.z >> 16) & 255) / 255.0
f;
244 const float ior = cugar::max( 3.0f * ((packed_info.z >> 24) / 255.0f), 0.00001f );
249 cugar::from_rgbe(packed_info.x),
250 cugar::from_rgbe(packed_info.y),
252 cugar::from_rgbe(packed_info.w),
260 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
266 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
272 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
278 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
284 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
293 const cugar::Matrix3x2f dp_dst = prim_dp_dst<kTextureCoords0>( renderer.mesh, geom_id.prim_id );
299 dp_ds = dp_ds - geom.normal_s * dot(dp_ds, geom.normal_s);
300 dp_dt = dp_dt - geom.normal_s * dot(dp_dt, geom.normal_s);
303 return dh_dst.y * cugar::cross(dp_ds, geom.normal_s) + dh_dst.x * cugar::cross(dp_dt, geom.normal_s);
316 const uint2& _packed_info1,
317 const uint4& _packed_info2,
323 alpha = cugar::from_rgbe(_packed_info1.y);
327 geom.position = _pos.xyz();
329 geom.normal_g = geom.normal_s;
330 geom.tangent = cugar::orthogonal(geom.normal_s);
331 geom.binormal = cugar::cross(geom.normal_s, geom.tangent);
348 geom_id.prim_id = hit.triId;
356 FERMAT_ASSERT(hit.triId < renderer.mesh.num_triangles);
359 #if !defined(BARYCENTRIC_HIT_POINT) 365 const int material_id = renderer.mesh.material_indices[hit.triId];
367 material = renderer.mesh.materials[material_id];
370 material.diffuse *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
371 material.specular *= bilinear_texture_lookup(geom.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
372 material.emissive *= bilinear_texture_lookup(geom.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
373 material.diffuse_trans *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_trans_map, renderer.textures,
cugar::Vector4f(1.0f));
377 geom.normal_s += 0.05f *
bump_mapping( geom_id, geom, material.bump_map, renderer );
378 geom.normal_s = cugar::normalize( geom.normal_s );
386 bsdf =
Bsdf(kParticleTransport, renderer, material);
398 setup(ray, hit, _alpha,
PathWeights(_weights), _depth, renderer);
401 prev_G_prime = fabsf(dot(in, geom.normal_s)) / fmaxf(hit.t * hit.t, MIN_G_DENOM);
403 prev_pG = pdf_product( _weights.out_p, _weights.out_cos_theta * prev_G_prime );
404 pGp_sum = _weights.pGp_sum +
mis_power(1 / pdf_product(_weights.pG, _weights.out_p));
423 FERMAT_ASSERT(_v.prim_id < (uint32)renderer.mesh.num_triangles);
427 const int material_id = renderer.mesh.material_indices[_v.prim_id];
429 material = renderer.mesh.materials[material_id];
432 material.diffuse *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
433 material.specular *= bilinear_texture_lookup(geom.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
434 material.emissive *= bilinear_texture_lookup(geom.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
435 material.diffuse_trans *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_trans_map, renderer.textures,
cugar::Vector4f(1.0f));
439 geom.normal_s += 0.05f *
bump_mapping( geom_id, geom, material.bump_map, renderer );
440 geom.normal_s = cugar::normalize( geom.normal_s );
443 in = cugar::normalize( _in );
448 bsdf =
Bsdf(kParticleTransport, renderer, material);
467 FERMAT_ASSERT(_v.prim_id < (uint32)renderer.mesh.num_triangles);
471 const int material_id = renderer.mesh.material_indices[_v.prim_id];
473 material = renderer.mesh.materials[material_id];
476 material.diffuse *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
477 material.specular *= bilinear_texture_lookup(geom.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
478 material.emissive *= bilinear_texture_lookup(geom.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
479 material.diffuse_trans *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_trans_map, renderer.textures,
cugar::Vector4f(1.0f));
483 geom.normal_s += 0.05f *
bump_mapping( geom_id, geom, material.bump_map, renderer );
484 geom.normal_s = cugar::normalize( geom.normal_s );
487 in = cugar::normalize( _in );
492 bsdf =
Bsdf(kParticleTransport, renderer, material);
495 prev_G_prime = fabsf(dot(in, geom.normal_s)) / fmaxf(cugar::square_length(_in), MIN_G_DENOM);
497 prev_pG = pdf_product( _weights.out_p, _weights.out_cos_theta * prev_G_prime );
498 pGp_sum = _weights.pGp_sum +
mis_power(1 / pdf_product(_weights.pG, _weights.out_p));
507 const uint2& _packed_info1,
508 const uint4& _packed_info2,
513 setup( _pos, _packed_info1, _packed_info2, _weights, _depth, renderer );
525 setup( _ray, _hit, _alpha, _weights, _depth, renderer );
537 setup( _in, _v, _alpha, _weights, _depth, renderer );
551 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
560 bool evaluate_full_bsdf =
false,
563 return bsdf.sample( geom, z, in, out_comp, out, out_p, out_p_proj, out_g, RR, evaluate_full_bsdf, components );
585 template <
typename RayType>
594 const float min_roughness = 0.0f)
596 geom_id.prim_id = hit.triId;
603 FERMAT_ASSERT(hit.triId < renderer.mesh.num_triangles);
606 #if !defined(BARYCENTRIC_HIT_POINT) 612 const int material_id = renderer.mesh.material_indices[hit.triId];
614 material = renderer.mesh.materials[material_id];
617 material.diffuse *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
618 material.specular *= bilinear_texture_lookup(geom.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
619 material.emissive *= bilinear_texture_lookup(geom.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
620 material.diffuse_trans *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_trans_map, renderer.textures,
cugar::Vector4f(1.0f));
624 geom.normal_s += 0.05f *
bump_mapping( geom_id, geom, material.bump_map, renderer );
625 geom.normal_s = cugar::normalize( geom.normal_s );
633 const float mollification_factor = 1.0f;
634 const float mollification_bias = 0.0f;
635 bsdf =
Bsdf(kRadianceTransport, renderer, material, mollification_factor, mollification_bias, min_roughness);
638 prev_G_prime = fabsf(dot(in, geom.normal_s)) / (hit.t * hit.t);
640 prev_pG = pdf_product( weights.out_p, weights.out_cos_theta * prev_G_prime );
641 pGp_sum = weights.pGp_sum +
mis_power(1 / pdf_product(weights.pG, weights.out_p));
659 FERMAT_ASSERT(_v.prim_id < uint32(renderer.mesh.num_triangles));
663 const int material_id = renderer.mesh.material_indices[_v.prim_id];
665 material = renderer.mesh.materials[material_id];
668 material.diffuse *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_map, renderer.textures,
cugar::Vector4f(1.0f));
669 material.specular *= bilinear_texture_lookup(geom.texture_coords, material.specular_map, renderer.textures,
cugar::Vector4f(1.0f));
670 material.emissive *= bilinear_texture_lookup(geom.texture_coords, material.emissive_map, renderer.textures,
cugar::Vector4f(1.0f));
671 material.diffuse_trans *= bilinear_texture_lookup(geom.texture_coords, material.diffuse_trans_map, renderer.textures,
cugar::Vector4f(1.0f));
675 geom.normal_s += 0.05f *
bump_mapping( geom_id, geom, material.bump_map, renderer );
676 geom.normal_s = cugar::normalize( geom.normal_s );
679 in = cugar::normalize( _in );
684 bsdf =
Bsdf(kRadianceTransport, renderer, material);
687 prev_G_prime = fabsf(dot(in, geom.normal_s)) / fmaxf(cugar::square_length(_in), MIN_G_DENOM);
689 prev_pG = pdf_product( weights.out_p, weights.out_cos_theta * prev_G_prime );
690 pGp_sum = weights.pGp_sum +
mis_power(1 / pdf_product(weights.pG, weights.out_p));
705 setup( _ray, _hit, _alpha, _weights, _depth, renderer );
717 setup( _in, _v, _alpha, _weights, _depth, renderer );
731 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
740 bool evaluate_full_bsdf =
false,
743 return bsdf.sample( geom, z, in, out_comp, out, out_p, out_p_proj, out_g, RR, evaluate_full_bsdf, components );
767 FERMAT_HOST_DEVICE
inline 771 const float d2 = fmaxf(MIN_G_DENOM, cugar::square_length(lv.geom.position - ev.geom.position));
776 out = (lv.geom.position - ev.geom.position) / d;
779 G = fabsf(cugar::dot(out, ev.geom.normal_s) * cugar::dot(out, lv.geom.normal_s)) / d2;
787 const Edf& light_bsdf = lv.edf;
797 const Bsdf& light_bsdf = lv.bsdf;
815 FERMAT_HOST_DEVICE
inline 818 bool direct_lighting_nee =
true,
819 bool direct_lighting_bsdf =
true)
822 const float d2 = fmaxf(MIN_G_DENOM, cugar::square_length(lv.geom.position - ev.geom.position));
827 out = (lv.geom.position - ev.geom.position) / d;
830 G = fabsf(cugar::dot(out, ev.geom.normal_s) * cugar::dot(out, lv.geom.normal_s)) / d2;
837 ev.bsdf.
f_and_p(ev.geom, ev.in, out, f_s, p_s, cugar::kProjectedSolidAngle, RR);
839 const float prev_pGp = pdf_product( ev.prev_pG, p_s );
844 const Edf& light_bsdf = lv.edf;
848 const float p_L = light_bsdf.
p(lv.geom, lv.geom.position, -out, cugar::kProjectedSolidAngle);
850 const float pGp = pdf_product( p_s, G, p_L );
851 const float next_pGp = pdf_product( p_L, lv.weights.pG );
854 lv.depth + 1, ev.depth + 2,
855 (ev.depth == 0 && direct_lighting_bsdf ==
false) ? 1.0f :
856 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
863 const Bsdf& light_bsdf = lv.bsdf;
870 light_bsdf.
f_and_p(lv.geom, lv.in, -out, f_L, p_L, cugar::kProjectedSolidAngle, RR);
872 const float pGp = pdf_product( p_s, G, p_L );
873 const float next_pGp = pdf_product( p_L, lv.weights.pG );
876 lv.depth + 1, ev.depth + 2,
877 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
892 FERMAT_HOST_DEVICE
inline 895 bool direct_lighting_nee =
true,
896 bool direct_lighting_bsdf =
true)
899 const float d2 = fmaxf(MIN_G_DENOM, cugar::square_length(lv.geom.position - ev.geom.position));
904 out = (lv.geom.position - ev.geom.position) / d;
907 G = fabsf(cugar::dot(out, ev.geom.normal_s) * cugar::dot(out, lv.geom.normal_s)) / d2;
913 ev.bsdf.
f_and_p(ev.geom, ev.in, out, f_s, p_s, cugar::kProjectedSolidAngle, RR);
915 const float prev_pGp = pdf_product( ev.prev_pG, p_s );
920 const Edf& light_bsdf = lv.edf;
923 f_L = light_bsdf.
f(lv.geom, lv.geom.position, -out);
924 const float p_L = light_bsdf.
p(lv.geom, lv.geom.position, -out, cugar::kProjectedSolidAngle);
926 const float pGp = pdf_product( p_s, G, p_L );
927 const float next_pGp = pdf_product( p_L, lv.weights.pG );
930 lv.depth + 1, ev.depth + 2,
931 (ev.depth == 0 && direct_lighting_bsdf ==
false) ? 1.0f :
932 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
937 const Bsdf& light_bsdf = lv.bsdf;
943 light_bsdf.
f_and_p(lv.geom, lv.in, -out, f_L, p_L, cugar::kProjectedSolidAngle, RR);
945 const float pGp = pdf_product( p_s, G, p_L );
946 const float next_pGp = pdf_product( p_L, lv.weights.pG );
949 lv.depth + 1, ev.depth + 2,
950 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
954 FERMAT_HOST_DEVICE
inline 955 void eval_connection(
958 bool direct_lighting_nee =
true,
959 bool direct_lighting_bsdf =
true)
962 const float d2 = fmaxf(MIN_G_DENOM, cugar::square_length(lv.geom.position - ev.geom.position));
967 out = (lv.geom.position - ev.geom.position) / d;
970 const float G = fabsf(cugar::dot(out, ev.geom.normal_s) * cugar::dot(out, lv.geom.normal_s)) / d2;
977 ev.bsdf.
f_and_p(ev.geom, ev.in, out, f_s, p_s, cugar::kProjectedSolidAngle, RR);
979 const float prev_pGp = pdf_product( ev.prev_pG, p_s );
983 if (direct_lighting_nee ==
false)
988 const Edf& light_bsdf = lv.edf;
992 const float p_L = light_bsdf.
p(lv.geom, lv.geom.position, -out, cugar::kProjectedSolidAngle);
994 const float pGp = pdf_product( p_s, G, p_L );
995 const float next_pGp = pdf_product( p_L, lv.weights.pG );
998 lv.depth + 1, ev.depth + 2,
999 (ev.depth == 0 && direct_lighting_bsdf ==
false) ? 1.0f :
1000 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
1003 out_w = ev.alpha * lv.alpha * f_L * f_s * G * mis_w;
1009 const Bsdf& light_bsdf = lv.bsdf;
1016 light_bsdf.
f_and_p(lv.geom, lv.in, -out, f_L, p_L, cugar::kProjectedSolidAngle, RR);
1018 const float pGp = pdf_product( p_s, G, p_L );
1019 const float next_pGp = pdf_product( p_L, lv.weights.pG );
1022 lv.depth + 1, ev.depth + 2,
1023 bpt_mis(pGp, prev_pGp, next_pGp, ev.pGp_sum + lv.weights.pGp_sum));
1026 out_w = ev.alpha * lv.alpha * f_L * f_s * G * mis_w;
1033 FERMAT_HOST_DEVICE
inline 1036 bool direct_lighting_nee,
1037 bool indirect_lighting_nee,
1045 renderer.mesh_vpls.
map(ev.geom_id.prim_id, ev.geom_id.uv, light_vertex_geom, &light_pdf, &light_edf);
1047 renderer.mesh_light.
map(ev.geom_id.prim_id, ev.geom_id.uv, light_vertex_geom, &light_pdf, &light_edf);
1050 const cugar::Vector3f f_L = light_edf.
f(light_vertex_geom, light_vertex_geom.position, ev.in);
1051 const float p_L = light_edf.
p(light_vertex_geom, light_vertex_geom.position, ev.in, cugar::kProjectedSolidAngle);
1053 const float pGp = pdf_product( p_L, light_pdf );
1054 const float prev_pGp = pdf_product( ev.prev_pG, p_L );
1058 (ev.depth == 0 || pGp == 0.0f || (ev.depth == 1 && direct_lighting_nee ==
false) || (ev.depth > 1 && indirect_lighting_nee ==
false)) ? 1.0f :
1059 bpt_mis(pGp, prev_pGp, ev.pGp_sum));
1062 return ev.alpha * f_L * mis_w;
1068 template <
typename VertexType>
1069 FERMAT_HOST_DEVICE FERMAT_FORCEINLINE
1071 const VertexType& v,
1079 bool output_alpha =
true,
1080 bool evaluate_full_bsdf =
false,
1083 bool scattered = v.bsdf.sample(
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float mis_power(const float w)
Definition: bpt_utils.h:70
CUGAR_HOST_DEVICE uint32 quantize(const float x, const uint32 n)
Definition: numbers.h:600
Definition: texture_reference.h:41
Definition: bpt_utils.h:110
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE uint4 pack_bsdf(const MeshMaterial &material)
Definition: bpt_utils.h:215
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f bump_mapping(const VertexGeometryId &geom_id, const VertexGeometry &geom, const TextureReference &bump_map, const RenderingContextView &renderer)
Definition: bpt_utils.h:285
FERMAT_HOST_DEVICE cugar::Vector3f eval_incoming_emission(const EyeVertex &ev, const RenderingContextView &renderer, bool direct_lighting_nee, bool indirect_lighting_nee, bool use_vpls)
Definition: bpt_utils.h:1034
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float unpack_bsdf_roughness(const uint4 packed_info)
Definition: bpt_utils.h:273
FERMAT_HOST_DEVICE void map(const uint32_t prim_id, const cugar::Vector2f &uv, VertexGeometry *geom, float *pdf, Edf *edf) const
Definition: lights.h:584
Defines various spherical mappings.
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f unpack_bsdf_diffuse_trans(const uint4 packed_info)
Definition: bpt_utils.h:279
ComponentType
Definition: bsdf.h:139
Definition: MeshView.h:55
TransportType
Definition: bsdf.h:83
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE Bsdf unpack_bsdf(const RenderingContextView &renderer, const uint4 packed_info, const TransportType transport=kParticleTransport)
Definition: bpt_utils.h:240
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
Definition: bpt_utils.h:131
Definition: bpt_utils.h:583
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f f(const DifferentialGeometry &geometry, const Vector3f in, const Vector3f out) const
Definition: lambert_edf.h:60
FERMAT_FORCEINLINE FERMAT_HOST_DEVICE void f_and_p(const cugar::DifferentialGeometry &geometry, const cugar::Vector3f w_i, const cugar::Vector3f w_o, cugar::Vector3f *f, float *p, const cugar::SphericalMeasure measure=cugar::kProjectedSolidAngle, bool RR=true) const
Definition: bsdf.h:366
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE Edf unpack_edf(const uint4 packed_info)
Definition: bpt_utils.h:231
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float p(const DifferentialGeometry &geometry, const Vector3f in, const Vector3f out, const SphericalMeasure measure=kProjectedSolidAngle) const
Definition: lambert_edf.h:80
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE bool scatter(const VertexType &v, const float z[3], Bsdf::ComponentType &out_component, cugar::Vector3f &out, float &out_p, float &out_p_proj, cugar::Vector3f &out_w, bool RR=true, bool output_alpha=true, bool evaluate_full_bsdf=false, Bsdf::ComponentType components=Bsdf::kAllComponents)
Definition: bpt_utils.h:1070
FERMAT_HOST_DEVICE void eval_connection_terms(const EyeVertex ev, const LightVertex &lv, cugar::Vector3f &out, cugar::Vector3f &f_conn, float &G, float &d)
Definition: bpt_utils.h:768
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f unpack_bsdf_diffuse(const uint4 packed_info)
Definition: bpt_utils.h:261
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Out binary_cast(const In in)
Definition: types.h:288
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f unpack_direction(const uint32 packed_dir)
Definition: vertex.h:133
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint8 comp(const uchar2 a, const char c)
Definition: numbers.h:218
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE bool sample(const float z[3], Bsdf::ComponentType &out_comp, cugar::Vector3f &out, float &out_p, float &out_p_proj, cugar::Vector3f &out_g, bool RR=true, bool evaluate_full_bsdf=false, const Bsdf::ComponentType components=Bsdf::kAllComponents) const
Definition: bpt_utils.h:732
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 cugar::Vector3f unpack_bsdf_specular(const uint4 packed_info)
Definition: bpt_utils.h:267
Definition: bpt_utils.h:311
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE bool sample(const float z[3], Bsdf::ComponentType &out_comp, cugar::Vector3f &out, float &out_p, float &out_p_proj, cugar::Vector3f &out_g, bool RR=true, bool evaluate_full_bsdf=false, const Bsdf::ComponentType components=Bsdf::kAllComponents) const
Definition: bpt_utils.h:552
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE uint4 pack_edf(const Edf &edf)
Definition: bpt_utils.h:189