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

Parallelizing color sampling for a pixel #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RishabhRD
Copy link
Owner

For rendering a pixel we throw n rays on viewport and render the average color of those rays. We refer this process as sampling. Because multiple rays are being sent and then being averaged, this process is good candidate for parallelisation.

However, parallel code is not performing any better than the sequential one. There can be multiple reason for the same. Some of them are:

  • For rendering each pixel, we actually do some memory allocation. This itself is taking so much time. Instead some kind of smart local allocators could help in this case to avoid OS calls.
  • There can be also a case for too much parallelism. It can be possible that sequentially computing the colors of each pixel is fast enough and parllelizing the same can be overhead.

Good level of profiling needs to be done for better insights. It would also help to gain more aspect of concurrency.

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.

1 participant