Skip to content

Commit

Permalink
Merge branch 'master' of github.com:appleseedhq/appleseed
Browse files Browse the repository at this point in the history
  • Loading branch information
dictoon committed Aug 22, 2016
2 parents 98d1dc5 + dcca59c commit 1e25ef3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/appleseed/renderer/modeling/bsdf/disneybrdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ namespace
const bool cosine_mult,
BSDFSample& sample) const APPLESEED_OVERRIDE
{
// No reflection below the shading surface.
const Vector3d& n = sample.get_shading_basis().get_normal();
const double cos_on = dot(sample.m_outgoing.get_value(), n);
if (cos_on < 0.0)
return;

const DisneyBRDFInputValues* values =
reinterpret_cast<const DisneyBRDFInputValues*>(data);

Expand All @@ -417,11 +423,6 @@ namespace
}
else
{
const Vector3d& n = sample.get_shading_basis().get_normal();
const double cos_on = std::min(dot(sample.m_outgoing.get_value(), n), 1.0);
if (cos_on < 0.0)
return;

if (s < cdf[SpecularComponent])
{
double alpha_x, alpha_y;
Expand Down
10 changes: 8 additions & 2 deletions src/appleseed/renderer/modeling/object/meshobjectreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,10 @@ namespace
objects[i]->set_motion_segment_count(key_frames.size() - 1);

for (size_t i = 0; i < objects.size(); ++i)
unshare_normals(*objects[i]);
{
if (objects[i]->get_vertex_normal_count() != 0)
unshare_normals(*objects[i]);
}

for (size_t i = 1; i < key_frames.size(); ++i)
{
Expand All @@ -756,7 +759,10 @@ namespace
return false;

for (size_t j = 0; j < poses.size(); ++j)
unshare_normals(*poses[j]);
{
if (poses[j]->get_vertex_normal_count() != 0)
unshare_normals(*poses[j]);
}

if (!set_vertex_poses(
objects,
Expand Down

0 comments on commit 1e25ef3

Please sign in to comment.