Skip to content

Rotatable light probe - #3090

Draft
richardTingle wants to merge 11 commits into
jMonkeyEngine:masterfrom
richardTingle:rotatable-light-probe
Draft

richardTingle wants to merge 11 commits into
jMonkeyEngine:masterfrom
richardTingle:rotatable-light-probe

Conversation

@richardTingle

@richardTingle richardTingle commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What this changes

This allows a light probe to be rotated after it is baked

Why I would want this

I have a control platform that the player stands on, and a scene in miniature that the player look at. Rotation command rotate that miniature scene (and the sky). The light probe is a one time back of sky.

This would be easy; rotate the sky, rotate the node the miniature is connected to and be done. However because the light probe can't be rotated that doesn't work and instead I have to move everything except the scene including moving and rotating the camera and the platform to give the impression the scene rotated.

image

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🖼️ Desktop screenshot changes

ℹ️ The purpose of these tests is to report when visual changes are introduced by a PR. If these
visual changes are intended, no action is required.

🔍 Results for 18e74fa (workflow run). Each report shows the reference image,
the new image and a diff side by side; artifact downloads need you to be signed in to GitHub.

🖥️ desktop (opengl) - compared against 78c60b9

✨ 3 new (no reference to compare against)
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testOrientedBoxProbeRotation_f6.png
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testProbeRotatedAgainstSky_f6.png
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testSphericalProbeRotation_f6.png

📄 Report: download screenshot-test-report-opengl, then open ScreenshotDiffReport.html from the zip. ⚠️ The report is produced by this pull request's code, so only open it if you trust the pull request.

🖥️ desktop (angle) - compared against 78c60b9

✨ 3 new (no reference to compare against)
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testOrientedBoxProbeRotation_f6_angle.png
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testProbeRotatedAgainstSky_f6_angle.png
org.jmonkeyengine.screenshottests.light.pbr.TestLightProbeRotation.testSphericalProbeRotation_f6_angle.png

📄 Report: download screenshot-test-report-angle, then open ScreenshotDiffReport.html from the zip. ⚠️ The report is produced by this pull request's code, so only open it if you trust the pull request.

📚 See the screenshot test README for more information.

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Richard, thanks for putting this together. The change gives probes a useful world-space orientation while keeping the capture, runtime lighting, and control paths connected, and the example makes the intended behavior easy to understand.

I reviewed the probe’s rotation and serialization state, the optional rotated-bake path, the shader inputs for both diffuse and specular IBL, and LightControl synchronization. In particular, carrying an oriented-box area through the same rotation delta as the probe preserves any pre-existing box alignment, while keeping the new baker overload backward-compatible for implementations that only support identity rotation is a thoughtful touch. The added unit and screenshot coverage exercise the core behavior and provide a practical visual check.

The main build and static-analysis checks are passing; one desktop-angle job is reported as failed, so it would be worth confirming whether that is environmental or needs follow-up before merge. I didn’t find a code issue requiring changes in this review. Nice work!

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🖼️ Android screenshot changes

🚨 Serious visual failure for 18e74fa (workflow run). Tests whose scenarios must render identically rendered differently. Unlike the changes a reviewer can confirm, this is never an intended result, and it has to be fixed.

🔍 Results for 18e74fa (workflow run). Each report shows the reference image,
the new image and a diff side by side; artifact downloads need you to be signed in to GitHub.

📱 android - compared against 78c60b9

🚨 2 rendered differently between scenarios
org.jmonkeyengine.screenshottests.android.light.pbr.TestLightProbeRotation.testOrientedBoxProbeRotation_f6_scenario-mismatch.png
org.jmonkeyengine.screenshottests.android.light.pbr.TestLightProbeRotation.testSphericalProbeRotation_f6_scenario-mismatch.png
✨ 3 new (no reference to compare against)
org.jmonkeyengine.screenshottests.android.light.pbr.TestLightProbeRotation.testOrientedBoxProbeRotation_f6.png
org.jmonkeyengine.screenshottests.android.light.pbr.TestLightProbeRotation.testProbeRotatedAgainstSky_f6.png
org.jmonkeyengine.screenshottests.android.light.pbr.TestLightProbeRotation.testSphericalProbeRotation_f6.png

📄 Report: download android-screenshot-report, then open extentReport/index.html from the zip. ⚠️ The report is produced by this pull request's code, so only open it if you trust the pull request.

📚 See the screenshot test README for more information.

…probe for the EnvironmentProbeControl that can lead to strange results
setNbMipMaps(mipSizes != null ? mipSizes.length : 1);

setShCoeffs(baker.getSphericalHarmonicsCoefficients());
setPosition(Vector3f.ZERO);

@richardTingle richardTingle Nov 28, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this was a bug (having setPosition). It has been here since the class was made and FastLightProbeFactory doesn't do this reset position thing. LightControl blats it anyway on the next tick by calling setPosition(the actual position)

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