Skip to content

Conversation

keptsecret
Copy link
Contributor

No description provided.

Comment on lines +100 to 106
static this_t create(NBL_CONST_REF_ARG(fresnel::Dielectric<spectral_type>) f, NBL_CONST_REF_ARG(spectral_type) luminosityContributionHint)
{
this_t retval;
retval.eta2 = eta2;
retval.fresnel = f;
retval.luminosityContributionHint = luminosityContributionHint;
return retval;
}
Copy link
Member

@devshgraphicsprogramming devshgraphicsprogramming Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have a create which fills all the members, only have the creates that do at least one thing of convenience

Comment on lines 163 to +166
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
{
const bool transmitted = ComputeMicrofacetNormal<scalar_type>::isTransmissionPath(interaction.getNdotV(), _sample.getNdotL());
const spectral_type reflectance = fresnel::thinDielectricInfiniteScatter<spectral_type>(fresnel::Dielectric<spectral_type>::__call(eta2, interaction.getNdotV(_clamp)));
const spectral_type reflectance = fresnel::thinDielectricInfiniteScatter<spectral_type>(fresnel(interaction.getNdotV(_clamp)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the ? in the comment above, explain that smooth BxDFs are isotropic by definition

Comment on lines +929 to 945
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
#define NBL_CONCEPT_PARAM_0 (bxdf, T)
#define NBL_CONCEPT_PARAM_1 (_sample, typename T::sample_type)
#define NBL_CONCEPT_PARAM_2 (aniso, typename T::anisotropic_interaction_type)
#define NBL_CONCEPT_PARAM_3 (anisocache, typename T::anisocache_type)
NBL_CONCEPT_BEGIN(4)
#define bxdf NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
#define _sample NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
#define aniso NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_2
#define anisocache NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_3
NBL_CONCEPT_END(
((NBL_CONCEPT_REQ_TYPE)(T::scalar_type))
((NBL_CONCEPT_REQ_TYPE)(T::isotropic_interaction_type))
((NBL_CONCEPT_REQ_TYPE)(T::anisotropic_interaction_type))
((NBL_CONCEPT_REQ_TYPE)(T::sample_type))
((NBL_CONCEPT_REQ_TYPE)(T::spectral_type))
((NBL_CONCEPT_REQ_TYPE)(T::quotient_pdf_type))
((NBL_CONCEPT_REQ_TYPE)(T::isocache_type))
((NBL_CONCEPT_REQ_TYPE)(T::anisocache_type))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not check bxdf_common instead of all the typedefs for scalar, specral, etc. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions in microfacet bxdfs also take cache. Checking bxdf_common would fail because those don't take cache (it's for the non cook torrance bxdfs). Probably a naming problem.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you'd have to split bxdf_common into typedef checking and then function checking on top

Comment on lines +33 to +47
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u)
{
// static_assert(!IsBSDF);
ray_dir_info_type L;
L.direction = sampling::ProjectedHemisphere<scalar_type>::generate(u);
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}

sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u)
{
// static_assert(IsBSDF);
ray_dir_info_type L;
L.direction = sampling::ProjectedSphere<scalar_type>::generate(u);
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is flaky, template the generate on the vector type and REQUIRE that vector_type==conditional_t<IsBSDF,vector3_type,vector2_type)

Comment on lines +68 to +82
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u)
{
// static_assert(!IsBSDF);
ray_dir_info_type L;
L.direction = sampling::ProjectedHemisphere<scalar_type>::generate(u);
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}

sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u)
{
// static_assert(IsBSDF);
ray_dir_info_type L;
L.direction = sampling::ProjectedSphere<scalar_type>::generate(u);
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as for the lambertian

@devshgraphicsprogramming devshgraphicsprogramming merged commit fb76cec into master Sep 19, 2025
19 of 20 checks passed
@devshgraphicsprogramming devshgraphicsprogramming deleted the bxdf_fixes_non_ct branch September 19, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants