Skip to content

Conversation

@riccardobl
Copy link
Member

Band factors were not applies to spherical harmonic coefficients in the accelerated baker, causing bad lighting on high roughness materials.
This PR fixes that for both IBLHybridEnvBakerLight (gpu+cpu) and IBLGLEnvBakerLight (gpu) bakers.

This PR also clamps the luminance in the prefiltered envmap kernel, to avoid fireflies artifacts when sampling over bright areas (that could be due to artistic choice or bad tonemap).

@github-actions
Copy link

🖼️ Screenshot tests have failed.

The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 Where to find the report:

  • Go to the (failed run) > Summary > Artifacts > screenshot-test-report
  • Download the zip and open jme3-screenshot-tests/build/reports/ScreenshotDiffReport.html

⚠️ If you didn't expect to change anything visual:
Fix your changes so the screenshot tests pass.

If you did mean to change things:
Review the replacement images in jme3-screenshot-tests/build/changed-images to make sure they really are improvements and then replace and commit the replacement images at jme3-screenshot-tests/src/test/resources.

If you are creating entirely new tests:
Find the new images in jme3-screenshot-tests/build/changed-images and commit the new images at jme3-screenshot-tests/src/test/resources.

Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".

See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information

@riccardobl
Copy link
Member Author

The screenshot test fails because it needs to be re-tuned to the correct lighting after the fix.
However now both the accelerated and non-accelerated baker outputs look mostly the same:

image
image

@yaRnMcDonuts
Copy link
Member

Looks good to me. Let me know if this all done and ready to merge, and then I'll work on a 3.8.1 release that includes this PR as well as the other PR related to instancing breaking.

Also if you're able to, it would be best to upload the new screenshot for the screenshot tests to fix that in this PR before merging. But if you're busy and unable to do that, then I can fix the screenshot test in another PR once this one is merged.

@riccardobl
Copy link
Member Author

Thank you, it should be good to go, but it is untested on android, also i would want to test it on a real pbr scene.
Currently i am working on a fork that is a bit of a mess, so i am unable to do the tests atm, but i should be able to upload the screenshot in a while. I just need to include the one generated by the test, right?

@yaRnMcDonuts
Copy link
Member

yaRnMcDonuts commented May 14, 2025

I just need to include the one generated by the test, right?

Yes, you should be able to just use the newly generated image to replace the old one in the jme-screenshot-tests directory, and then that should make the test pass again.

I also won't be of much help testing this currently. Even though I do have some larger PBR scenes using light probes in my project, I am still not at the point of generating my own probes yet, and I just use the DefaultProbe.j3o (from jme-testdata) in most of my scenes. But I do plan to generate custom probes for my scenes eventually, so when that time comes, I'll be able to offer much more help testing generated probes.

@yaRnMcDonuts
Copy link
Member

yaRnMcDonuts commented May 16, 2025

I'll work on a 3.8.1 release that includes this PR as well as the other PR related to instancing breaking.

I ended up just putting the other PR in 3.8.1 and held off on this since you said it still needs tested more.

And since its not standard to do a beta/alpha for a 3.8 patch release I figured its best probably to hold off on this PR so that it can be more thoroughly tested during the 3.9 alpha release that should be coming soon.

@yaRnMcDonuts yaRnMcDonuts added this to the v3.9.0 milestone May 20, 2025
@yaRnMcDonuts yaRnMcDonuts merged commit 8cec96f into jMonkeyEngine:master May 28, 2025
15 of 16 checks passed
@yaRnMcDonuts
Copy link
Member

Merging this so it can be tested in the soon-to-come 3.9.0-alpha1 release. I'll also submit another PR to update the screenshot test very soon.

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.

2 participants