Skip to content
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

Merged
merged 5 commits into from Jan 17, 2017
Merged

Plastic BRDF #1216

merged 5 commits into from Jan 17, 2017

Conversation

est77
Copy link
Member

@est77 est77 commented Jan 16, 2017

Similar to Mitsuba's rough plastic.

plastic_tester

@est77 est77 changed the title Plastic brdf Plastic BRDF Jan 16, 2017
// https://github.com/mitsuba-renderer/mitsuba
//

const char* Model = "plastic_bsdf";
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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;
Copy link
Member

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))
Copy link
Member

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(
Copy link
Member

Choose a reason for hiding this comment

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

Remove redundant namespace qualifiers.

@dictoon
Copy link
Member

dictoon commented Jan 17, 2017

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.

@dictoon
Copy link
Member

dictoon commented Jan 17, 2017

Make sure to update the test scenes as well.

@est77
Copy link
Member Author

est77 commented Jan 17, 2017

Should be good to merge now.

@dictoon dictoon merged commit 4a8dcd1 into appleseedhq:master Jan 17, 2017
@dictoon
Copy link
Member

dictoon commented Jan 17, 2017

Thank you!

@est77 est77 deleted the est_plastic_brdf branch January 17, 2017 20:40
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.

None yet

2 participants