1#ifndef _BBM_COSINEWEIGHTEDLOG_H_
2#define _BBM_COSINEWEIGHTEDLOG_H_
31 template<
typename CONF>
requires concepts::config<CONF>
39 auto v = bbm::log(1 +
value*cosTheta);
40 auto r = bbm::log(1 +
reference*cosTheta);
61 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
65 struct lowLog :
public sampledlossfunction<BSDF, REFERENCE, lowLog_error<get_config<BSDF>>, spherical_linearizer<get_config<BSDF>>, COMPONENT, UNIT>
82 const vec2d<Size_t>& samplesIn,
83 const Size_t& samplesOut,
84 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
85 const Scalar& startOut=0,
const Scalar& endOut=Constants::Pi(0.5))
86 :
sampledlossfunction<BSDF, REFERENCE,
lowLog_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
lowLog_error<Config>(),
spherical_linearizer<Config>(samplesIn, vec2d<Size_t>(1, samplesOut), startIn, endIn, startOut, Vec2d(Constants::Pi(2.0), endOut))) {}
100 template<
typename CONF>
requires concepts::config<CONF>
108 auto v = bbm::log(1 +
value*cosTheta);
109 auto r = bbm::log(1 +
reference*cosTheta);
130 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
134 struct bieronLog :
public sampledlossfunction<BSDF, REFERENCE, bieronLog_error<get_config<BSDF>>, spherical_linearizer<get_config<BSDF>>, COMPONENT, UNIT>
151 const vec2d<Size_t>& samplesIn,
152 const vec2d<Size_t>& samplesOut,
153 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
154 const Vec2d& startOut=0,
const Vec2d& endOut=Constants::Hemisphere())
155 :
sampledlossfunction<BSDF, REFERENCE,
bieronLog_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
bieronLog_error<Config>(),
spherical_linearizer<Config>(samplesIn, samplesOut, startIn, endIn, startOut, endOut)) {}
169 template<
typename CONF>
requires concepts::config<CONF>
177 auto v = bbm::log(1 +
value*cosTheta);
178 auto r = bbm::log(1 +
reference*cosTheta);
199 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
220 const vec2d<Size_t>& samplesIn,
221 const vec2d<Size_t>& samplesOut,
222 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
223 const Vec2d& startOut=0,
const Vec2d& endOut=Constants::Hemisphere())
224 :
sampledlossfunction<BSDF, REFERENCE,
standardLog_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
standardLog_error<Config>(),
spherical_linearizer<Config>(samplesIn, samplesOut, startIn, endIn, startOut, endOut)) {}
Definition of a loss function that is the sum of losses on samples.
BSDF implementation of a BSDF model.
Definition: bsdf.h:30
bsdfmodel concept
Definition: bsdfmodel.h:33
matching_config concept
Definition: config.h:63
Definition: samplelossfunction.h:28
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
T sinTheta(const vec2d< T > &v)
Definition: spherical.h:75
T cosTheta(const vec2d< T > &v)
Definition: spherical.h:109
Definition: aggregatebsdf.h:29
decltype(auto) value(T &&t)
return the value of an attribute, or if not an attribute the object
Definition: attribute_value.h:20
Methods for handling spherical coordinates.
Bieron and Peers cosine weighted log error.
Definition: cosine_weighted_log.h:102
Value operator()(const Vec3d &in, const Vec3d &out, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_log.h:105
bieronLog loss function
Definition: cosine_weighted_log.h:135
bieronLog(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const vec2d< Size_t > &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Vec2d &startOut=0, const Vec2d &endOut=Constants::Hemisphere())
Constructor.
Definition: cosine_weighted_log.h:150
Low et al.'s cosine weighted log error.
Definition: cosine_weighted_log.h:33
Value operator()(const Vec3d &in, const Vec3d &, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_log.h:36
lowLog loss function
Definition: cosine_weighted_log.h:66
lowLog(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const Size_t &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Scalar &startOut=0, const Scalar &endOut=Constants::Pi(0.5))
Constructor.
Definition: cosine_weighted_log.h:81
Non-persistent reference (i.e., cannot take rvalues)
Definition: reference.h:86
sampledlossfunction
Definition: sampledlossfunction.h:35
Definition: spherical_linearizer.h:26
Cosine weighted log error weighted by sin theta of in and out.
Definition: cosine_weighted_log.h:171
Value operator()(const Vec3d &in, const Vec3d &out, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_log.h:174
standardLog loss function
Definition: cosine_weighted_log.h:204
standardLog(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const vec2d< Size_t > &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Vec2d &startOut=0, const Vec2d &endOut=Constants::Hemisphere())
Constructor.
Definition: cosine_weighted_log.h:219