-
Notifications
You must be signed in to change notification settings - Fork 280
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
Reduce rendered images without considering opacity #4877
Conversation
Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution! |
thanks for the pull request! I'll review in detail soon, but you're getting a lot of real test failures that you could fix by making your new |
Thanks! Made the change to a keyword and now |
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 seems sound, but we should probably add a test too. In the mean time here are a couple suggestions
Co-authored-by: Clément Robert <[email protected]>
@yt-fido test this please |
1 similar comment
@yt-fido test this please |
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 looks good to me. Apologies for the very delayed review here, @biboyd
@neutrinoceros I'm not certain what could be added for a test since the changes here only have an effect when running with MPI. any ideas?
Do you mean we don't have any form of continuous testing with MPI yet ? if so, I'd agree to leave it out of this PR, but we should probably open issue for it. |
Ya, that's what I meant (but wasn't positive about it). So IMO this PR is OK as it is. |
Thanks for clarifying. Feel free to merge then. |
Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆 |
PR Summary
Issue
This addresses issue #4871, where volume renders of multiple fields with MPI would only produce a portion of the second field in the final image.
I believe I have found where this bug occurs. It mainly has to do with the combining of image arrays in
yt/utilities/amr_kdtree/amr_kdtools.py:receive_and_reduce()
and how the alpha channel is set inyt/visualization/volume_rendering/render_source.py:VolumeSource.finialize_image()
After the first source is rendered, the last step of
finalize_image()
sets the alpha channel of the image array to1
'syt/yt/visualization/volume_rendering/render_source.py
Lines 535 to 537 in 6d121f5
This causes issues when the second source is combining the image arrays in
recieve_and_reduce()
as these two arrays are combined by scaling theback
image byta
,1
minus thefront
alpha channel. Since the alpha channel was already set by the first source,ta
is a zeros array. This eliminates any contribution ofback
to the final image.yt/yt/utilities/amr_kdtree/amr_kdtools.py
Lines 25 to 34 in 6d121f5
Solution
My proposed solution is to add a pathway to combine image arrays without the consideration of opacity. This would be used when
transfer_function.grey_opacity=False
. In this case,front
andback
don't have any relevance and we can simply add the two image arrays.PR Checklist