6#include <Common/assertion.h>
7#include <Common/primitive_type.h>
35 std::optional<real> m_roughnessV;
42 StructType ztruct(
"microsurface");
43 ztruct.description(
"Describing microsurface structure of the material.");
46 microsurface.
description(
"Type of the microsurface of the material.");
49 ztruct.addField(microsurface);
53 "Isotropic surface roughness in [0, 1], the material will appear "
54 "to be smoother with smaller roughness value.");
57 ztruct.addField(roughness);
61 "Similar to the `roughness` parameter, but is used for anisotropic "
62 "surface appearances. This value controls the V component of "
63 "surface roughness. If this value is provided, the `roughness` "
64 "parameter is interpreted as the U component of surface roughness.");
65 ztruct.addField(roughnessV);
68 roughnessToAlpha.
description(
"Type of the mapping to transform roughness into alpha value.");
71 ztruct.addField(roughnessToAlpha);
74 maskingShadowing.
description(
"Type of the masking and shadowing for a microsurface.");
77 ztruct.addField(maskingShadowing);
87 return !m_roughnessV.has_value() ||
88 (m_roughnessV.has_value() && m_roughness == *m_roughnessV);
101 PH_ASSERT(m_roughnessV.has_value());
103 return {m_roughness, *m_roughnessV};
Definition MicrosurfaceInfo.h:19
bool isIsotropic() const
Definition MicrosurfaceInfo.h:85
real getIsotropicRoughness() const
Definition MicrosurfaceInfo.h:91
std::pair< real, real > getAnisotropicUVRoughnesses() const
Definition MicrosurfaceInfo.h:98
PH_DEFINE_SDL_STRUCT(TSdlOwnerStruct< MicrosurfaceInfo >)
Definition MicrosurfaceInfo.h:40
std::unique_ptr< Microfacet > genMicrofacet(EInterfaceMicrosurface defaultType=EInterfaceMicrosurface::TrowbridgeReitz) const
Definition MicrosurfaceInfo.cpp:14
Definition TSdlEnumField.h:23
SDL binding type for a typical C++ struct.
Definition TSdlOwnerStruct.h:18
A field class that binds a floating point member variable.
Definition TSdlReal.h:21
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
The root for all renderer implementations.
Definition EEngineProject.h:6
EMaskingShadowing
Different types of masking and shadowing terms for microfacet distributions. Eric Heitz has published...
Definition enums.h:11
ERoughnessToAlpha
Definition sdl_component_enums.h:26
EInterfaceMicrosurface
Definition sdl_component_enums.h:18