Forráskód Böngészése

Create additional screenshot tests and add an auto message on screenshot test failure

This adds screenshot tests for:

TestIssue2076
TestMotionPath
TestSimpleBumps
This also:

Automatically posts a comment if a screenshot test fails to help inform users what to do
Richard Tingle 4 hónapja
szülő
commit
dff1c33d3e

+ 117 - 0
.github/workflows/screenshot-test-comment.yml

@@ -0,0 +1,117 @@
+name: Screenshot Test PR Comment
+
+# This workflow is designed to safely comment on PRs from forks
+# It uses pull_request_target which has higher permissions than pull_request
+# Security note: This workflow does NOT check out or execute code from the PR
+# It only monitors the status of the ScreenshotTests job and posts comments
+# (If this commenting was done in the main worflow it would not have the permissions
+# to create a comment)
+
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  monitor-screenshot-tests:
+    name: Monitor Screenshot Tests and Comment
+    runs-on: ubuntu-latest
+    timeout-minutes: 60
+    permissions:
+      pull-requests: write
+      contents: read
+    steps:
+      - name: Wait for GitHub to register the workflow run
+        run: sleep 15
+
+      - name: Wait for Screenshot Tests to complete
+        uses: lewagon/[email protected]
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+          check-name: 'Run Screenshot Tests'
+          repo-token: ${{ secrets.GITHUB_TOKEN }}
+          wait-interval: 10
+          allowed-conclusions: success,skipped,failure
+      - name: Check Screenshot Tests status
+        id: check-status
+        uses: actions/github-script@v6
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            const { owner, repo } = context.repo;
+            const ref = '${{ github.event.pull_request.head.sha }}';
+
+            // Get workflow runs for the PR
+            const runs = await github.rest.actions.listWorkflowRunsForRepo({
+              owner,
+              repo,
+              head_sha: ref
+            });
+
+            // Find the ScreenshotTests job
+            let screenshotTestRun = null;
+            for (const run of runs.data.workflow_runs) {
+              if (run.name === 'Build jMonkeyEngine') {
+                const jobs = await github.rest.actions.listJobsForWorkflowRun({
+                  owner,
+                  repo,
+                  run_id: run.id
+                });
+
+                for (const job of jobs.data.jobs) {
+                  if (job.name === 'Run Screenshot Tests') {
+                    screenshotTestRun = job;
+                    break;
+                  }
+                }
+
+                if (screenshotTestRun) break;
+              }
+            }
+
+            if (!screenshotTestRun) {
+              console.log('Screenshot test job not found');
+              return;
+            }
+
+            // Check if the job failed
+            if (screenshotTestRun.conclusion === 'failure') {
+              core.setOutput('failed', 'true');
+            } else {
+              core.setOutput('failed', 'false');
+            }
+      - name: Find Existing Comment
+        uses: peter-evans/find-comment@v3
+        id: existingCommentId
+        with:
+          issue-number: ${{ github.event.pull_request.number }}
+          comment-author: 'github-actions[bot]'
+          body-includes: Screenshot tests have failed.
+
+      - name: Comment on PR if tests fail
+        if: steps.check-status.outputs.failed == 'true'
+        uses: peter-evans/create-or-update-comment@v4
+        with:
+          issue-number: ${{ github.event.pull_request.number }}
+          body: |
+            🖼️ **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
+          edit-mode: replace
+          comment-id: ${{ steps.existingCommentId.outputs.comment-id }}

+ 3 - 2
jme3-screenshot-tests/README.md

@@ -1,7 +1,8 @@
 # jme3-screenshot-tests
 
-This module contains tests that compare screenshots of the JME3 test applications to reference images. The tests are run using 
-the following command:
+This module contains tests that compare screenshots of the JME3 test applications to reference images. Think of these like visual unit tests
+
+The tests are run using the following command:
 
 ```
  ./gradlew :jme3-screenshot-test:screenshotTest

+ 143 - 0
jme3-screenshot-tests/src/test/java/org/jmonkeyengine/screenshottests/animation/TestIssue2076.java

@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2024 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.jmonkeyengine.screenshottests.animation;
+
+import com.jme3.anim.SkinningControl;
+import com.jme3.anim.util.AnimMigrationUtils;
+import com.jme3.animation.SkeletonControl;
+import com.jme3.app.Application;
+import com.jme3.app.SimpleApplication;
+import com.jme3.app.state.BaseAppState;
+import com.jme3.asset.AssetManager;
+import com.jme3.light.AmbientLight;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Vector3f;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.Node;
+import com.jme3.scene.VertexBuffer;
+import org.jmonkeyengine.screenshottests.testframework.ScreenshotTestBase;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Screenshot test for JMonkeyEngine issue #2076: software skinning requires vertex
+ * normals.
+ *
+ * <p>If the issue is resolved, 2 copies of the Jaime model will be rendered in the screenshot.
+ *
+ * <p>If the issue is present, then the application will immediately crash,
+ * typically with a {@code NullPointerException}.
+ *
+ * @author Stephen Gold (original test)
+ * @author Richard Tingle (screenshot test adaptation)
+ */
+public class TestIssue2076 extends ScreenshotTestBase {
+
+    /**
+     * This test creates a scene with two Jaime models, one using the old animation system
+     * and one using the new animation system, both with software skinning and no vertex normals.
+     */
+    @Test
+    public void testIssue2076() {
+        screenshotTest(new BaseAppState() {
+            @Override
+            protected void initialize(Application app) {
+                SimpleApplication simpleApplication = (SimpleApplication) app;
+                Node rootNode = simpleApplication.getRootNode();
+                AssetManager assetManager = simpleApplication.getAssetManager();
+
+                // Add ambient light
+                AmbientLight ambientLight = new AmbientLight();
+                ambientLight.setColor(new ColorRGBA(1f, 1f, 1f, 1f));
+                rootNode.addLight(ambientLight);
+
+                /*
+                 * The original Jaime model was chosen for testing because it includes
+                 * tangent buffers (needed to trigger issue #2076) and uses the old
+                 * animation system (so it can be easily used to test both systems).
+                 */
+                String assetPath = "Models/Jaime/Jaime.j3o";
+
+                // Test old animation system
+                Node oldJaime = (Node) assetManager.loadModel(assetPath);
+                rootNode.attachChild(oldJaime);
+                oldJaime.setLocalTranslation(-1f, 0f, 0f);
+
+                // Enable software skinning
+                SkeletonControl skeletonControl = oldJaime.getControl(SkeletonControl.class);
+                skeletonControl.setHardwareSkinningPreferred(false);
+
+                // Remove its vertex normals
+                Geometry oldGeometry = (Geometry) oldJaime.getChild(0);
+                Mesh oldMesh = oldGeometry.getMesh();
+                oldMesh.clearBuffer(VertexBuffer.Type.Normal);
+                oldMesh.clearBuffer(VertexBuffer.Type.BindPoseNormal);
+
+                // Test new animation system
+                Node newJaime = (Node) assetManager.loadModel(assetPath);
+                AnimMigrationUtils.migrate(newJaime);
+                rootNode.attachChild(newJaime);
+                newJaime.setLocalTranslation(1f, 0f, 0f);
+
+                // Enable software skinning
+                SkinningControl skinningControl = newJaime.getControl(SkinningControl.class);
+                skinningControl.setHardwareSkinningPreferred(false);
+
+                // Remove its vertex normals
+                Geometry newGeometry = (Geometry) newJaime.getChild(0);
+                Mesh newMesh = newGeometry.getMesh();
+                newMesh.clearBuffer(VertexBuffer.Type.Normal);
+                newMesh.clearBuffer(VertexBuffer.Type.BindPoseNormal);
+
+                // Position the camera to see both models
+                simpleApplication.getCamera().setLocation(new Vector3f(0f, 0f, 5f));
+            }
+
+            @Override
+            protected void cleanup(Application app) {
+            }
+
+            @Override
+            protected void onEnable() {
+            }
+
+            @Override
+            protected void onDisable() {
+            }
+
+            @Override
+            public void update(float tpf) {
+                super.update(tpf);
+            }
+        }).run();
+    }
+}

+ 188 - 0
jme3-screenshot-tests/src/test/java/org/jmonkeyengine/screenshottests/animation/TestMotionPath.java

@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2024 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.jmonkeyengine.screenshottests.animation;
+
+import com.jme3.app.Application;
+import com.jme3.app.SimpleApplication;
+import com.jme3.app.state.BaseAppState;
+import com.jme3.asset.AssetManager;
+import com.jme3.cinematic.MotionPath;
+import com.jme3.cinematic.MotionPathListener;
+import com.jme3.cinematic.events.MotionEvent;
+import com.jme3.font.BitmapText;
+import com.jme3.input.ChaseCamera;
+import com.jme3.light.DirectionalLight;
+import com.jme3.material.Material;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.FastMath;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.shape.Box;
+import org.jmonkeyengine.screenshottests.testframework.ScreenshotTestBase;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Screenshot test for the MotionPath functionality.
+ * 
+ * <p>This test creates a teapot model that follows a predefined path with several waypoints.
+ * The animation is automatically started and screenshots are taken at frames 10 and 60
+ * to capture the teapot at different positions along the path.
+ *
+ * @author Richard Tingle (screenshot test adaptation)
+ */
+public class TestMotionPath extends ScreenshotTestBase {
+
+    /**
+     * This test creates a scene with a teapot following a motion path.
+     */
+    @Test
+    public void testMotionPath() {
+        screenshotTest(new BaseAppState() {
+            private Spatial teapot;
+            private MotionPath path;
+            private MotionEvent motionControl;
+            private BitmapText wayPointsText;
+
+            @Override
+            protected void initialize(Application app) {
+                SimpleApplication simpleApplication = (SimpleApplication) app;
+                Node rootNode = simpleApplication.getRootNode();
+                Node guiNode = simpleApplication.getGuiNode();
+                AssetManager assetManager = simpleApplication.getAssetManager();
+
+                // Set camera position
+                app.getCamera().setLocation(new Vector3f(8.4399185f, 11.189463f, 14.267577f));
+
+                // Create the scene
+                createScene(rootNode, assetManager);
+
+                // Create the motion path
+                path = new MotionPath();
+                path.addWayPoint(new Vector3f(10, 3, 0));
+                path.addWayPoint(new Vector3f(10, 3, 10));
+                path.addWayPoint(new Vector3f(-40, 3, 10));
+                path.addWayPoint(new Vector3f(-40, 3, 0));
+                path.addWayPoint(new Vector3f(-40, 8, 0));
+                path.addWayPoint(new Vector3f(10, 8, 0));
+                path.addWayPoint(new Vector3f(10, 8, 10));
+                path.addWayPoint(new Vector3f(15, 8, 10));
+                path.enableDebugShape(assetManager, rootNode);
+
+                // Create the motion event
+                motionControl = new MotionEvent(teapot, path);
+                motionControl.setDirectionType(MotionEvent.Direction.PathAndRotation);
+                motionControl.setRotation(new Quaternion().fromAngleNormalAxis(-FastMath.HALF_PI, Vector3f.UNIT_Y));
+                motionControl.setInitialDuration(10f);
+                motionControl.setSpeed(2f);
+
+                // Create text for waypoint notifications
+                wayPointsText = new BitmapText(assetManager.loadFont("Interface/Fonts/Default.fnt"));
+                wayPointsText.setSize(wayPointsText.getFont().getCharSet().getRenderedSize());
+                guiNode.attachChild(wayPointsText);
+
+                // Add listener for waypoint events
+                path.addListener(new MotionPathListener() {
+                    @Override
+                    public void onWayPointReach(MotionEvent control, int wayPointIndex) {
+                        if (path.getNbWayPoints() == wayPointIndex + 1) {
+                            wayPointsText.setText(control.getSpatial().getName() + " Finished!!! ");
+                        } else {
+                            wayPointsText.setText(control.getSpatial().getName() + " Reached way point " + wayPointIndex);
+                        }
+                        wayPointsText.setLocalTranslation(
+                                (app.getCamera().getWidth() - wayPointsText.getLineWidth()) / 2,
+                                app.getCamera().getHeight(),
+                                0);
+                    }
+                });
+
+                // note that the ChaseCamera is self-initialising, so just creating this object attaches it
+                new ChaseCamera(getApplication().getCamera(), teapot);
+
+                // Start the animation automatically
+                motionControl.play();
+            }
+
+            private void createScene(Node rootNode, AssetManager assetManager) {
+                // Create materials
+                Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
+                mat.setFloat("Shininess", 1f);
+                mat.setBoolean("UseMaterialColors", true);
+                mat.setColor("Ambient", ColorRGBA.Black);
+                mat.setColor("Diffuse", ColorRGBA.DarkGray);
+                mat.setColor("Specular", ColorRGBA.White.mult(0.6f));
+
+                Material matSoil = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
+                matSoil.setBoolean("UseMaterialColors", true);
+                matSoil.setColor("Ambient", ColorRGBA.Black);
+                matSoil.setColor("Diffuse", ColorRGBA.Black);
+                matSoil.setColor("Specular", ColorRGBA.Black);
+
+                // Create teapot
+                teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
+                teapot.setName("Teapot");
+                teapot.setLocalScale(3);
+                teapot.setMaterial(mat);
+                rootNode.attachChild(teapot);
+
+                // Create ground
+                Geometry soil = new Geometry("soil", new Box(50, 1, 50));
+                soil.setLocalTranslation(0, -1, 0);
+                soil.setMaterial(matSoil);
+                rootNode.attachChild(soil);
+
+                // Add light
+                DirectionalLight light = new DirectionalLight();
+                light.setDirection(new Vector3f(0, -1, 0).normalizeLocal());
+                light.setColor(ColorRGBA.White.mult(1.5f));
+                rootNode.addLight(light);
+            }
+
+            @Override
+            protected void cleanup(Application app) {
+            }
+
+            @Override
+            protected void onEnable() {
+            }
+
+            @Override
+            protected void onDisable() {
+            }
+        })
+        .setFramesToTakeScreenshotsOn(10, 60)
+        .run();
+    }
+}

+ 125 - 0
jme3-screenshot-tests/src/test/java/org/jmonkeyengine/screenshottests/material/TestSimpleBumps.java

@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2024 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.jmonkeyengine.screenshottests.material;
+
+import com.jme3.app.Application;
+import com.jme3.app.SimpleApplication;
+import com.jme3.app.state.BaseAppState;
+import com.jme3.asset.AssetManager;
+import com.jme3.light.PointLight;
+import com.jme3.material.Material;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.FastMath;
+import com.jme3.math.Vector3f;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.shape.Quad;
+import com.jme3.scene.shape.Sphere;
+import com.jme3.util.mikktspace.MikktspaceTangentGenerator;
+import org.jmonkeyengine.screenshottests.testframework.ScreenshotTestBase;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Screenshot test for the SimpleBumps material test.
+ * 
+ * <p>This test creates a quad with a bump map material and a point light that orbits around it.
+ * The light's position is represented by a small red sphere. Screenshots are taken at frames 10 and 60
+ * to capture the light at different positions in its orbit.
+ * 
+ * @author Richard Tingle (screenshot test adaptation)
+ */
+public class TestSimpleBumps extends ScreenshotTestBase {
+
+    /**
+     * This test creates a scene with a bump-mapped quad and an orbiting light.
+     */
+    @Test
+    public void testSimpleBumps() {
+        screenshotTest(new BaseAppState() {
+            private float angle;
+            private PointLight pl;
+            private Spatial lightMdl;
+
+            @Override
+            protected void initialize(Application app) {
+                SimpleApplication simpleApplication = (SimpleApplication) app;
+                Node rootNode = simpleApplication.getRootNode();
+                AssetManager assetManager = simpleApplication.getAssetManager();
+
+                // Create quad with bump map material
+                Quad quadMesh = new Quad(1, 1);
+                Geometry sphere = new Geometry("Rock Ball", quadMesh);
+                Material mat = assetManager.loadMaterial("Textures/BumpMapTest/SimpleBump.j3m");
+                sphere.setMaterial(mat);
+                MikktspaceTangentGenerator.generate(sphere);
+                rootNode.attachChild(sphere);
+
+                // Create light representation
+                lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
+                lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
+                rootNode.attachChild(lightMdl);
+
+                // Create point light
+                pl = new PointLight();
+                pl.setColor(ColorRGBA.White);
+                pl.setPosition(new Vector3f(0f, 0f, 4f));
+                rootNode.addLight(pl);
+            }
+
+            @Override
+            protected void cleanup(Application app) {
+            }
+
+            @Override
+            protected void onEnable() {
+            }
+
+            @Override
+            protected void onDisable() {
+            }
+
+            @Override
+            public void update(float tpf) {
+                super.update(tpf);
+
+                angle += tpf * 2f;
+                angle %= FastMath.TWO_PI;
+
+                pl.setPosition(new Vector3f(FastMath.cos(angle) * 4f, 0.5f, FastMath.sin(angle) * 4f));
+                lightMdl.setLocalTranslation(pl.getPosition());
+            }
+        })
+        .setFramesToTakeScreenshotsOn(10, 60)
+        .run();
+    }
+}

BIN
jme3-screenshot-tests/src/test/resources/org.jmonkeyengine.screenshottests.animation.TestIssue2076.testIssue2076_f1.png


BIN
jme3-screenshot-tests/src/test/resources/org.jmonkeyengine.screenshottests.animation.TestMotionPath.testMotionPath_f10.png


BIN
jme3-screenshot-tests/src/test/resources/org.jmonkeyengine.screenshottests.animation.TestMotionPath.testMotionPath_f60.png


BIN
jme3-screenshot-tests/src/test/resources/org.jmonkeyengine.screenshottests.material.TestSimpleBumps.testSimpleBumps_f10.png


BIN
jme3-screenshot-tests/src/test/resources/org.jmonkeyengine.screenshottests.material.TestSimpleBumps.testSimpleBumps_f60.png