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

Physically-based Sky Model based on Nishita93 #2907

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

Conversation

joelbarmettlerUZH
Copy link

@joelbarmettlerUZH joelbarmettlerUZH commented Jan 7, 2021

This PR implements a new environmentEDF based on the Nishita93 sky model.
The sky model was implemented by me as part of a university thesis with support from @LZaw.

The here proposed sky model, referred to as "Applesky20" within my thesis, implements Nishita93 single scattering sky model but extends on Nishita93 by adding the support for Ozone. A comparison of the here proposed "Applesky20" model shows that it can easily compete with the new physical sky model released by Blender v2.92 a few months ago. A port of Blender Cycles sky model can be found in my fork of appleseed.

Full implementation details are given in my bachelor thesis about phsyically based sky models in appleseed.

This PR is marked as "WIP" since the following issues must be resolved first:

  • Sky brightness issues must be discussed in the appleseed #dev-physical-sky channel. Fore more details, please read the first paraph of Subsection 6.3.1: Visual Comparison of my thesis. I will open up a new discussion thread in discord.
  • There are some minor compiling issues on Linux that must be resolved first, mainly regarding the CMAKE file. These issues can be resolved rather quickly and they only affect Linux users (to my knowledge).

None the less, a first review of this PR would be much appreciated, primarily focusing (at least) on the following:

  • Compliance with appleseeds coding standards
  • General structure of the classes and files
  • Correctness of the overall algorithm
  • Inefficient, overcomplicated or suboptimal functions or routines

Note that a full review (testing with demo-scenes etc.) will only be possible once the three points above are resolved.

@LZaw LZaw added PR | Squash This PR must be squashed when merged. WIP ⚠ labels Jan 7, 2021
Copy link
Member

@LZaw LZaw left a comment

Choose a reason for hiding this comment

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

Hey,
This is a first iteration. I didn't mark all things everywhere, but one or two examples of the same thing (e.g. comments, alignment, formatting in general).
I didn't go into the math and numbers yet, that's up for a second iteration (possibly joined).
I'm not sure about the current class/namespace/... splits. I'll evaluate the workflow in a later iteration and possibly come up with a different module-layout.

class opticaldepth {

public:
float rayleigh;
Copy link
Member

Choose a reason for hiding this comment

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

classvariables start with an m_. Also, why did you make them public?

Copy link
Author

Choose a reason for hiding this comment

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

I do need to access these variables in physicalsky.cpp l:226, for example.
I could write a getter, but I don't think that is very C++ like. What would be your recommended solution?


// Sun irradiance (W*m^-2*nm^-1) values at the top of the atmosphere.
// Source: https://www.nrel.gov/grid/solar-resource/spectra.html, Table SMART MODTRAN ETR Spectra.
const float sun_radiance[num_wavelengths] = {
Copy link
Member

Choose a reason for hiding this comment

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

These values are already present in src/modeling/light/sunlight.cpp. Can we join them somehow?

Copy link
Author

Choose a reason for hiding this comment

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

Let's discuss a good solution for joining these arrays before I touch someone elses code :)


using namespace foundation;

namespace nishita {
Copy link
Member

Choose a reason for hiding this comment

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

As we discussed before, I think a class makes more sense here.

@joelbarmettlerUZH
Copy link
Author

Thanks for the review! I'll try to resolve most of the commends next week, maybe we can schedule a meeting afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR | Squash This PR must be squashed when merged. WIP ⚠
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants