Fix issue where sun would contribute to reflections despite Draw Sun being disabled.#1576
Fix issue where sun would contribute to reflections despite Draw Sun being disabled.#1576ThatRedox wants to merge 1 commit into
Draw Sun being disabled.#1576Conversation
…ode out to another method.
There was a problem hiding this comment.
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.
| 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.
| 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.
| 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.
| 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.