-
Notifications
You must be signed in to change notification settings - Fork 79
Fix issue where sun would contribute to reflections despite Draw Sun being disabled.
#1576
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
Conversation
…ode out to another method.
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 is not a bug. Sunlight is meant to be disabled not with the Draw sun control, but rather with the Sun Sampling Strategy control set to NON_LUMINOUS.
This PR makes non-sampled sunlight again depend on the state of the Draw sun control (The issue was #1317, and was fixed by #1474). The Draw sun control should have no effect over the sunlight that the scene receives. If a user wishes to disable sunlight, then the user should set Sun Sampling Strategy to NON_LUMINOUS. Having more than one way to disable sunlight could be confusing to users.
| } | ||
|
|
||
| return false; | ||
| return doIntersect(ray, apparentTextureBrightness); |
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.
| return doIntersect(ray, apparentTextureBrightness); | |
| return doIntersect(ray, apparentTextureBrightness, false); |
| */ | ||
| public boolean intersectDiffuse(Ray ray) { | ||
| if (ray.d.dot(sw) < .5) { | ||
| return doIntersect(ray, color); |
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.
| return doIntersect(ray, color); | |
| return doIntersect(ray, color, true); |
| return doIntersect(ray, color); | ||
| } | ||
|
|
||
| private boolean doIntersect(Ray ray, Vector3 color) { |
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.
| private boolean doIntersect(Ray ray, Vector3 color) { | |
| private boolean doIntersect(Ray ray, Vector3 color, boolean isDiffuse) { |
| } | ||
|
|
||
| private boolean doIntersect(Ray ray, Vector3 color) { | ||
| if (!drawTexture || ray.d.dot(sw) < .5) { |
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.
| if (!drawTexture || ray.d.dot(sw) < .5) { | |
| if ((!isDiffuse && !drawTexture) || ray.d.dot(sw) < .5) { |
Calling it |
|
I suggest that we put a hint in the
|
|
Replaced by #1577 |
If

Draw sunand `Sun Sampling Strategy are disabled, the sun still contributes to reflections:(500 exposure).
This PR adds the
drawSuncheck toSun.diffuseIntersectwhich was causing this issue.