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
Plastic BRDF #1216
Plastic BRDF #1216
Conversation
// https://github.com/mitsuba-renderer/mitsuba | ||
// | ||
|
||
const char* Model = "plastic_bsdf"; |
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.
That should probably be plastic_brdf
.
const Basis3f& shading_basis(sample.m_shading_basis); | ||
const Vector3f& n = shading_basis.get_normal(); | ||
const Vector3f& outgoing = sample.m_outgoing.get_value(); | ||
const float cos_on = std::min(dot(outgoing, n), 1.0f); |
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 redundant namespace qualifier.
const float alpha = microfacet_alpha_from_roughness(values->m_roughness); | ||
|
||
// Compute the microfacet normal by sampling the MDF. | ||
Vector3f wo = shading_basis.transform_to_local(outgoing); |
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.
Make const.
Vector3f wo = shading_basis.transform_to_local(outgoing); | ||
sampling_context.split_in_place(4, 1); | ||
const Vector4f s = sampling_context.next2<Vector4f>(); | ||
Vector3f m = m_mdf->sample(wo, Vector3f(s[0], s[1], s[2]), alpha, alpha); |
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.
Make const.
|
||
const float alpha = microfacet_alpha_from_roughness(values->m_roughness); | ||
|
||
float probability = 0.0; |
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.
0.0f
|
||
float probability = 0.0f; | ||
|
||
if (ScatteringMode::has_glossy(modes)) |
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.
Add curly braces around multi-line blocks.
const Vector3f& m) | ||
{ | ||
float f; | ||
foundation::fresnel_reflectance_dielectric( |
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 redundant namespace qualifiers.
Looking pretty good! Just a few minor things to fix and it's good to merge. I like the fact that the internal scattering parameter is a float, not a boolean. |
Make sure to update the test scenes as well. |
Should be good to merge now. |
Thank you! |
Similar to Mitsuba's rough plastic.