Struct intersection_surface_t

Struct Documentation

struct intersection_surface_t

Describes a beam-surface intersection geometry.

Public Types

using tidx_t = mesh::mesh_t::tidx_t

Public Functions

intersection_surface_t(const shape_t *shape, const dir3_t &geo_n, const tidx_t mesh_tri_idx, const barycentric_t &bary, const pqvec3_t &beam_intersection_centre) noexcept
intersection_surface_t(const shape_t *shape, const tidx_t mesh_tri_idx, const barycentric_t &bary) noexcept
inline intersection_surface_t(const shape_t *shape, const ads::tri_t &ads_tri, const ray_t &ray, const intersect::intersect_ray_tri_ret_t &ray_intersection_record) noexcept
inline intersection_surface_t(const dir3_t &geo_n, const pqvec3_t &beam_intersection_centre) noexcept
intersection_surface_t(const intersection_surface_t&) noexcept = default
inline const auto &ng() const noexcept
inline const auto &ns() const noexcept
const mesh::surface_differentials_t &tangent_frame() const noexcept
inline auto s_direction(const dir3_t &w) const noexcept

Returns the s-polarization direction in world coordinates (normal to incidence plane).

Parameters:

w – incident or outgoing direction

inline auto sp_frame(const dir3_t &w) const noexcept

Constructs the sp frame, where t is the s-polarization direction (normal to incidence plane) and b is the p-polarization direction (aligns with incidence plane).

Parameters:

w – incident or outgoing direction

texture::texture_query_t texture_query(const wavenumber_t &k) const noexcept

Constructs a texture query structure. When the shape BSDF sets needs_interaction_footprint() to TRUE, this also populates the appropriate partial derivatives in the texture query by calling pdvs_at_intersection().

intersection_uv_pdvs_t pdvs_at_intersection() const noexcept

Computes the partial derivatives w.r.t. to beam footprint.

pqvec3_t offseted_ray_origin(const ray_t &ray) const noexcept

Computes an offseted origin that avoids self-intersection.

Public Members

pqvec3_t wp

Centre world position point of beam-surface intersection.

vec2_t uv

Linearly-interpolated vertex UV coordinates at interaction centre.

barycentric_t bary

The barycentric coordinates.

intersection_footprint_t footprint

Footprint of beam intersection (spanned in geometric geo tangent frame, centred around wp).

tidx_t mesh_tri_idx
const shape_t *shape = nullptr
frame_t geo

Geometric frame.

frame_t shading

Shading frame. Shading frame is defined by the linearly-interpolated vertices’ shading normals, and potentially further perturbed by the shape’s BSDF (e.g., if the BSDF does normal mapping).