Skip to content

Commit 774c8f2

Browse files
all CI scenes load without crashing but coating and bumpmap handling (meta BSDF) is not yet complete!
1 parent 492874d commit 774c8f2

4 files changed

Lines changed: 189 additions & 182 deletions

File tree

include/nbl/asset/material_compiler3/CFrontendIR.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,15 @@ class CFrontendIR final : public CNodePool
743743
// To quickly make a matching backface material from a frontface or vice versa
744744
NBL_API2 typed_pointer_type<IExprNode> reciprocate(const typed_pointer_type<const IExprNode> other);
745745
NBL_API2 typed_pointer_type<CFresnel> createNamedFresnel(const std::string_view name);
746+
inline typed_pointer_type<CFresnel> createConstantMonochromeRealFresnel(const hlsl::float32_t orientedRealEta)
747+
{
748+
const auto fresnelH = getObjectPool().emplace<CFresnel>();
749+
CSpectralVariable::SCreationParams<1> params = {};
750+
params.knots.params[0].scale = orientedRealEta;
751+
if (auto* const fresnel=getObjectPool().deref(fresnelH); fresnel)
752+
fresnel->orientedRealEta = getObjectPool().emplace<CSpectralVariable>(std::move(params));
753+
return fresnelH;
754+
}
746755

747756
// IMPORTANT: Two BxDFs are not allowed to be multiplied together.
748757
// NOTE: Right now all Spectral Variables are required to be Monochrome or 3 bucket fixed semantics, all the same wavelength.

include/nbl/ext/MitsubaLoader/CElementBSDF.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,8 @@ class CElementBSDF : public IElement
132132
inline RoughSpecularBase& operator=(const RoughSpecularBase& other)
133133
{
134134
distribution = other.distribution;
135-
switch (distribution)
136-
{
137-
case ASHIKHMIN_SHIRLEY:
138-
alphaU = other.alphaU;
139-
alphaV = other.alphaV;
140-
break;
141-
default:
142-
alpha = other.alpha;
143-
break;
144-
}
135+
alphaU = other.alphaU;
136+
alphaV = other.alphaV;
145137
specularReflectance = other.specularReflectance;
146138
return *this;
147139
}

include/nbl/ext/MitsubaLoader/SContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ struct SContext final
8787
#endif
8888
core::smart_refctd_ptr<frontend_ir_t> frontIR;
8989
// common frontend nodes
90+
frontend_ir_t::typed_pointer_type<const frontend_ir_t::IExprNode> errorBRDF;
91+
frontend_ir_t::typed_pointer_type<const frontend_ir_t::CLayer> unsupportedPhong, unsupportedWard;
9092
frontend_ir_t::typed_pointer_type<const frontend_ir_t::CDeltaTransmission> deltaTransmission;
9193
// Common Debug Names
9294
enum class ECommonDebug : uint16_t

0 commit comments

Comments
 (0)