@Override
            protected void initialize(Application app) {
                Camera cam = app.getCamera();
                cam.setLocation(new Vector3f(18, 10, 0));
                cam.lookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y);

                AssetManager assetManager = app.getAssetManager();
                assetManager.registerLoader(KTXLoader.class, "ktx");

                app.getViewPort().setBackgroundColor(ColorRGBA.White);

                modelNode = new Node("modelNode");
                Geometry model = (Geometry) assetManager.loadModel("Models/Tank/tank.j3o");
                MikktspaceTangentGenerator.generate(model);
                modelNode.attachChild(model);

                DirectionalLight dl = new DirectionalLight();
                dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
                SimpleApplication simpleApp = (SimpleApplication) app;
                simpleApp.getRootNode().addLight(dl);
                dl.setColor(ColorRGBA.White);

                // If we need to update the light direction to match camera
                if (updateLight) {
                    dl.setDirection(app.getCamera().getDirection().normalize());
                }

                simpleApp.getRootNode().attachChild(modelNode);

                FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
                int numSamples = app.getContext().getSettings().getSamples();
                if (numSamples > 0) {
                    fpp.setNumSamples(numSamples);
                }

                fpp.addFilter(new ToneMapFilter(Vector3f.UNIT_XYZ.mult(4.0f)));
                app.getViewPort().addProcessor(fpp);

                Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/Path.hdr", SkyFactory.EnvMapType.EquirectMap);
                simpleApp.getRootNode().attachChild(sky);

                Material pbrMat = assetManager.loadMaterial("Models/Tank/tank.j3m");
                pbrMat.setFloat("Roughness", roughness);
                model.setMaterial(pbrMat);

                // Set up environment camera
                EnvironmentCamera envCam = new EnvironmentCamera(RESOLUTION, new Vector3f(0, 3f, 0));
                app.getStateManager().attach(envCam);
            }
Test PBR lighting with different parameters

@param testName The name of the test (used for screenshot filename)
@param roughness The roughness value to use
@param updateLight Whether to update the directional light to match camera direction
jme3-screenshot-tests/src/test/java/org/jmonkeyengine/screenshottests/light/pbr/TestPBRLighting.java