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

Adapt C++ examples to recent changes in appleseed #2751

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mango-3
Copy link
Member

@Mango-3 Mango-3 commented Dec 25, 2019

  • Removed obsolete appleseed integer types
  • Added override of pure virtual function of derived class to be able to instantiate it.

These changes allow building of the example files though I'm not sure it is the most elegant way to do it (adding the override).
Also there is still an issue with parts of the objects appearing black when rendering (see screenshot of sphereobject)
sphereobject

@Mango-3 Mango-3 requested a review from dictoon December 25, 2019 14:34
@oktomus
Copy link
Member

oktomus commented Dec 26, 2019

Was it already black before ?

@Mango-3
Copy link
Member Author

Mango-3 commented Dec 27, 2019

I haven't run this example before so I cannot say with certainty. But I doubt the black part is correct. Looks like a bug.

@dictoon
Copy link
Member

dictoon commented Dec 27, 2019

Thanks!

It wasn't black before. This almost certainly is a self-intersection issue: refine_and_offset() must return valid front & back intersection points.

@@ -151,6 +151,13 @@ namespace
return raymarch(ray, t, p);
}

void refine_and_offset(
const foundation::Ray3d& obj_inst_ray,
Copy link
Member

Choose a reason for hiding this comment

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

Use asf:: qualifier.

Copy link
Member

Choose a reason for hiding this comment

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

Align arguments.

asf::hash_uint64(asf::binary_cast<asf::uint64>(ray.m_dir.x)) ^
asf::hash_uint64(asf::binary_cast<asf::uint64>(ray.m_dir.y)) ^
asf::hash_uint64(asf::binary_cast<asf::uint64>(ray.m_dir.z)));
asf::hash_uint64(asf::binary_cast<uint64_t>(ray.m_org.x)) ^
Copy link
Member

Choose a reason for hiding this comment

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

Prefix integral types with std::.

@dictoon
Copy link
Member

dictoon commented Dec 27, 2019

Now that appleseed has a built-in sphere object, the sphere object plugin is kind of redundant even though it's a nice, simple example of how to write an object plugin (but maybe we could implement another shape).

Anyway, you could have a look at how the built-in sphere object implements refining if you want to fix the sphere object plugin:

https://github.com/appleseedhq/appleseed/blob/master/src/appleseed/renderer/modeling/object/sphereobject.cpp#L136-L188

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

3 participants