-
Notifications
You must be signed in to change notification settings - Fork 65
bxdf fixes: non cook-torrance stuff #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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; | ||
} |
There was a problem hiding this comment.
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
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))); |
There was a problem hiding this comment.
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
#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)) |
There was a problem hiding this comment.
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. ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
include/nbl/builtin/hlsl/bxdf/reflection/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/reflection/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/transmission/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/transmission/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/reflection/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/reflection/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
include/nbl/builtin/hlsl/bxdf/transmission/delta_distribution.hlsl
Outdated
Show resolved
Hide resolved
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()); | ||
} |
There was a problem hiding this comment.
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)
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()); | ||
} |
There was a problem hiding this comment.
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
No description provided.