Skip to content

Commit 7006828

Browse files
fix bugs and revert a normal change
1 parent 778c582 commit 7006828

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

examples_tests/22.RaytracedAO/raytraceCommon.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ nbl_glsl_xoroshiro64star_state_t load_aux_vertex_attrs(
187187
const nbl_glsl_xoroshiro64star_state_t scramble_start_state = imageLoad(scramblebuf,ivec3(outPixelLocation,1u/*vertex_depth_mod_2*/)).rg;
188188

189189
// while waiting for the scramble state
190-
const bool needsSmoothNormals = false;
190+
const bool needsSmoothNormals = true;
191191
if (needsSmoothNormals)
192192
{
193193
const mat3 normals = mat3(

include/nbl/ext/MitsubaLoader/CElementBSDF.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class CElementBSDF : public IElement
5858
struct AllDiffuse
5959
{
6060
AllDiffuse() : reflectance(0.5f), alpha(0.2f), useFastApprox(false) {}
61+
~AllDiffuse() {}
6162

6263
inline AllDiffuse& operator=(const AllDiffuse& other)
6364
{
@@ -67,7 +68,11 @@ class CElementBSDF : public IElement
6768
return *this;
6869
}
6970

70-
CElementTexture::SpectrumOrTexture reflectance;
71+
union // to support the unholy undocumented feature of Mitsuba
72+
{
73+
CElementTexture::SpectrumOrTexture reflectance;
74+
CElementTexture::SpectrumOrTexture diffuseReflectance;
75+
};
7176
CElementTexture::FloatOrTexture alpha; // not the parameter from Oren-Nayar
7277
bool useFastApprox;
7378
};

src/nbl/ext/MitsubaLoader/CElementBSDF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ bool CElementBSDF::addProperty(SNamedPropertyElement&& _property)
432432
});
433433
};
434434
auto processSpecularReflectance = SET_SPECTRUM(specularReflectance, SPECULAR_TYPES,Phong,Ward);
435-
auto processDiffuseReflectance = SET_SPECTRUM(diffuseReflectance, AllPlastic,Phong,Ward);
435+
auto processDiffuseReflectance = SET_SPECTRUM(diffuseReflectance, AllDiffuse,AllPlastic,Phong,Ward);
436436
auto processSpecularTransmittance = SET_SPECTRUM(specularTransmittance, TRANSMISSIVE_TYPES);
437437
#undef SPECULAR_TYPES
438438
#undef TRANSMISSIVE_TYPES
@@ -693,7 +693,7 @@ bool CElementBSDF::processChildData(IElement* _child, const std::string& name)
693693
auto processAlphaU = SET_TEXTURE(alphaU, SPECULAR_TYPES);
694694
auto processAlphaV = SET_TEXTURE(alphaV, SPECULAR_TYPES);
695695
auto processSpecularReflectance = SET_TEXTURE(specularReflectance, SPECULAR_TYPES,Phong,Ward);
696-
auto processDiffuseReflectance = SET_TEXTURE(diffuseReflectance, AllPlastic,Phong,Ward);
696+
auto processDiffuseReflectance = SET_TEXTURE(diffuseReflectance, AllDiffuse,AllPlastic,Phong,Ward);
697697
auto processSpecularTransmittance = SET_TEXTURE(specularTransmittance, TRANSMISSIVE_TYPES);
698698
auto processSigmaA = SET_TEXTURE(sigmaA, AllCoating);
699699
auto processExponent = SET_TEXTURE(exponent, Phong);

0 commit comments

Comments
 (0)