normal mapped¶
-
class normalmap_t : public wt::bsdf::bsdf_t
Normal mapping BSDF. A nested texture encodes the shading normal variations ([.5,.5,1.] encodes an unchanged normal). Bitmap textures should use linear colour conding.
Public Functions
-
normalmap_t(normalmap_t&&) = default
-
inline virtual frame_t shading_frame(const texture::texture_query_t &tquery, const mesh::surface_differentials_t &tangent_frame, const dir3_t &ns) const noexcept override
Constructs a shading frame in world space. This is useful for BSDFs that perturb the shading frame, like normal or bump maps.
- Parameters:
tquery – texture query data.
tangent_frame – mesh tangent frame at intersection.
ns – interpolated shading normal at intersection.
-
inline virtual std::optional<f_t> albedo(const wavenumber_t k) const noexcept override
Spectral albedo. Returns std::nullopt when albedo cannot be computed.
- Parameters:
k – wavenumber
-
inline virtual lobe_mask_t lobes(wavenumber_t k) const noexcept override
Returns mask of all available lobes for this BSDF at particular wavenumber.
-
inline virtual bool is_delta_only(wavenumber_t k) const noexcept override
Does this BSDF comprise of only delta lobes?
-
inline virtual bool is_delta_lobe(wavenumber_t k, std::uint32_t lobe) const noexcept override
Is a lobe a delta lobe?
-
inline virtual bool needs_interaction_footprint() const noexcept override
Returns true for BSDF that make use of the surface interaction footprint data.
-
inline virtual bsdf_result_t f(const dir3_t &wi, const dir3_t &wo, const bsdf_query_t &query) const noexcept override
Evaluates the BSDF. Accounts for the cosine foreshortening term.
-
inline virtual std::optional<bsdf_sample_t> sample(const dir3_t &wi, const bsdf_query_t &query, sampler::sampler_t &sampler) const noexcept override
Samples the BSDF. The returned weight is bsdf/pdf.
- Parameters:
S – normalized Stokes parameters vector that describes the polarimetric properties of incident radiation.
-
inline virtual solid_angle_density_t pdf(const dir3_t &wi, const dir3_t &wo, const bsdf_query_t &query) const noexcept override
Provides the sample density.
- Parameters:
S – normalized Stokes parameters vector that describes the polarimetric properties of incident radiation.
-
inline virtual f_t eta(const dir3_t &wi, const dir3_t &wo, const wavenumber_t k) const noexcept override
Computes the refractive-index ratio: eta at exit / eta at entry.
- Parameters:
k – wavenumber
-
inline const auto &nested_bsdf() const noexcept
-
virtual scene::element::info_t description() const override
Public Static Functions
-
static std::unique_ptr<bsdf_t> load(std::string id, scene::loader::loader_t *loader, const scene::loader::node_t &node, const wt::wt_context_t &context)
-
normalmap_t(normalmap_t&&) = default