Browse Source

Added an easy way to view PBR Models in the SDK using two buttons (currently chimpanzees, hit me up if you have icons), where one is adding a lightprobe and the other a skybox to allow watching the model.

MeFisto94 6 years ago
parent
commit
137a7ca521

+ 2 - 2
jme3-core/nbproject/project.properties

@@ -1,11 +1,11 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
 #Thu, 25 Aug 2011 20:26:48 +0200
 file.reference.DDSUtils.jar=release/modules/ext/DDSUtils.jar
 file.reference.DDSUtils.jar=release/modules/ext/DDSUtils.jar
 #Thu, 25 Aug 2011 19:32:54 +0200
 #Thu, 25 Aug 2011 19:32:54 +0200
-javac.source=1.6
+javac.source=1.7
 javac.compilerargs=-Xlint -Xlint\:-serial
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org
 nbm.homepage=http\://www.jmonkeyengine.org
 nbm.module.author=Normen Hansen
 nbm.module.author=Normen Hansen
 nbm.needs.restart=true
 nbm.needs.restart=true
 project.license=jme
 project.license=jme
-spec.version.base=3.2.0
+spec.version.base=3.3.0

+ 10 - 3
jme3-core/nbproject/project.xml

@@ -12,7 +12,7 @@
                     <compile-dependency/>
                     <compile-dependency/>
                     <run-dependency>
                     <run-dependency>
                         <release-version>1</release-version>
                         <release-version>1</release-version>
-                        <specification-version>3.2.0</specification-version>
+                        <specification-version>3.3.0</specification-version>
                     </run-dependency>
                     </run-dependency>
                 </dependency>
                 </dependency>
                 <dependency>
                 <dependency>
@@ -21,13 +21,20 @@
                     <compile-dependency/>
                     <compile-dependency/>
                     <run-dependency>
                     <run-dependency>
                         <release-version>1</release-version>
                         <release-version>1</release-version>
-                        <specification-version>3.2.0</specification-version>
+                        <specification-version>3.3.0</specification-version>
                     </run-dependency>
                     </run-dependency>
                 </dependency>
                 </dependency>
                 <dependency>
                 <dependency>
                     <code-name-base>com.jme3.gde.core.updatecenters</code-name-base>
                     <code-name-base>com.jme3.gde.core.updatecenters</code-name-base>
                     <run-dependency>
                     <run-dependency>
-                        <specification-version>3.2.0</specification-version>
+                        <specification-version>3.3.0</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>com.jme3.gde.project.testdata</code-name-base>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>3.3</specification-version>
                     </run-dependency>
                     </run-dependency>
                 </dependency>
                 </dependency>
                 <dependency>
                 <dependency>

+ 87 - 6
jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java

@@ -46,12 +46,14 @@ import com.jme3.input.FlyByCamera;
 import com.jme3.input.MouseInput;
 import com.jme3.input.MouseInput;
 import com.jme3.input.controls.MouseAxisTrigger;
 import com.jme3.input.controls.MouseAxisTrigger;
 import com.jme3.input.controls.MouseButtonTrigger;
 import com.jme3.input.controls.MouseButtonTrigger;
+import com.jme3.light.LightProbe;
 import com.jme3.light.PointLight;
 import com.jme3.light.PointLight;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.Vector3f;
 import com.jme3.math.Vector3f;
 import com.jme3.renderer.RenderManager;
 import com.jme3.renderer.RenderManager;
 import com.jme3.renderer.ViewPort;
 import com.jme3.renderer.ViewPort;
 import com.jme3.renderer.queue.RenderQueue.Bucket;
 import com.jme3.renderer.queue.RenderQueue.Bucket;
+import com.jme3.scene.Geometry;
 import com.jme3.scene.Node;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 import com.jme3.scene.Spatial;
 import com.jme3.scene.Spatial.CullHint;
 import com.jme3.scene.Spatial.CullHint;
@@ -60,6 +62,7 @@ import com.jme3.system.JmeCanvasContext;
 import com.jme3.system.awt.AwtPanel;
 import com.jme3.system.awt.AwtPanel;
 import com.jme3.system.awt.AwtPanelsContext;
 import com.jme3.system.awt.AwtPanelsContext;
 import com.jme3.system.awt.PaintMode;
 import com.jme3.system.awt.PaintMode;
+import com.jme3.util.SkyFactory;
 import java.awt.Component;
 import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ActionListener;
@@ -134,6 +137,8 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     private Thread thread;
     private Thread thread;
     private NodeSyncAppState nodeSync;
     private NodeSyncAppState nodeSync;
     private FakeApplication fakeApp;
     private FakeApplication fakeApp;
+    private LightProbe pbrLightProbe;
+    private Spatial pbrSky;
 
 
     public SceneApplication() {
     public SceneApplication() {
         Logger.getLogger("com.jme3").addHandler(logHandler);
         Logger.getLogger("com.jme3").addHandler(logHandler);
@@ -183,6 +188,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
 
     private void attachPanel() {
     private void attachPanel() {
         enqueue(new Callable() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
             public Object call() throws Exception {
                 panel.attachTo(true, viewPort, overlayView, guiViewPort);
                 panel.attachTo(true, viewPort, overlayView, guiViewPort);
                 return null;
                 return null;
@@ -334,6 +340,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
     }
 
 
     //TODO: Lookup for Application
     //TODO: Lookup for Application
+    @Override
     public Lookup createAdditionalLookup(Lookup baseContext) {
     public Lookup createAdditionalLookup(Lookup baseContext) {
         return Lookups.fixed(getApplication());
         return Lookups.fixed(getApplication());
     }
     }
@@ -348,24 +355,22 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
     }
 
 
     private void notifyOpen(final SceneRequest opened) {
     private void notifyOpen(final SceneRequest opened) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneOpened(opened);
             sceneViewerListener.sceneOpened(opened);
         }
         }
     }
     }
 
 
     private void notifyClose(final SceneRequest closed) {
     private void notifyClose(final SceneRequest closed) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneClosed(closed);
             sceneViewerListener.sceneClosed(closed);
         }
         }
     }
     }
 
 
     public void notifyPreview(final PreviewRequest request) {
     public void notifyPreview(final PreviewRequest request) {
         java.awt.EventQueue.invokeLater(new Runnable() {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
             public void run() {
-                for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-                    SceneListener sceneViewerListener = it.next();
+                for (SceneListener sceneViewerListener : listeners) {
                     sceneViewerListener.previewCreated(request);
                     sceneViewerListener.previewCreated(request);
                 }
                 }
             }
             }
@@ -388,6 +393,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         }
         }
         closeScene(currentSceneRequest, request);
         closeScene(currentSceneRequest, request);
         java.awt.EventQueue.invokeLater(new Runnable() {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
             public void run() {
                 if (request == null) {
                 if (request == null) {
                     return;
                     return;
@@ -418,6 +424,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 request.setFakeApp(fakeApp);
                 request.setFakeApp(fakeApp);
                 fakeApp.newAssetManager(manager);
                 fakeApp.newAssetManager(manager);
                 enqueue(new Callable() {
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                     public Object call() throws Exception {
                         if (manager != null) {
                         if (manager != null) {
                             assetManager = manager;
                             assetManager = manager;
@@ -450,6 +457,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
 
     private void closeScene(final SceneRequest oldRequest, final SceneRequest newRequest) {
     private void closeScene(final SceneRequest oldRequest, final SceneRequest newRequest) {
         java.awt.EventQueue.invokeLater(new Runnable() {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
             public void run() {
                 if (oldRequest == null) {
                 if (oldRequest == null) {
                     return;
                     return;
@@ -474,6 +482,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 //TODO: state list is not thread safe..
                 //TODO: state list is not thread safe..
                 fakeApp.removeCurrentStates();
                 fakeApp.removeCurrentStates();
                 enqueue(new Callable() {
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                     public Object call() throws Exception {
                         if (physicsState != null) {
                         if (physicsState != null) {
                             physicsState.getPhysicsSpace().removeAll(rootNode);
                             physicsState.getPhysicsSpace().removeAll(rootNode);
@@ -548,6 +557,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
 
     public void enableCamLight(final boolean enabled) {
     public void enableCamLight(final boolean enabled) {
         enqueue(new Callable() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
             public Object call() throws Exception {
                 if (enabled) {
                 if (enabled) {
                     rootNode.removeLight(camLight);
                     rootNode.removeLight(camLight);
@@ -562,6 +572,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
 
     public void enableStats(final boolean enabled) {
     public void enableStats(final boolean enabled) {
         enqueue(new Callable() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
             public Object call() throws Exception {
                 if (enabled) {
                 if (enabled) {
                     guiNode.attachChild(statsGuiNode);
                     guiNode.attachChild(statsGuiNode);
@@ -575,6 +586,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
 
     public void enableWireFrame(final boolean selected) {
     public void enableWireFrame(final boolean selected) {
         enqueue(new Callable() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
             public Object call() throws Exception {
                 if (selected) {
                 if (selected) {
                     viewPort.addProcessor(wireProcessor);
                     viewPort.addProcessor(wireProcessor);
@@ -585,9 +597,76 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
             }
             }
         });
         });
     }
     }
+    
+    public void enablePBRProbe(final boolean selected) {
+        if (pbrLightProbe == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    Spatial s = assetManager.loadModel("com/jme3/gde/core/sceneviewer/pbrenv.j3o");
+                    pbrLightProbe = (LightProbe)s.getLocalLightList().get(0);
+                    s.getLocalLightList().clear();
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.addLight(pbrLightProbe);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.addLight(pbrLightProbe);
+                    } else {
+                        rootNode.removeLight(pbrLightProbe);
+                    }
+                    return null;
+                }
+            });
+        }
+    }
+    
+    public void enablePBRSkybox(final boolean selected) {
+        if (pbrSky == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    pbrSky = SkyFactory.createSky(assetManager, "Textures/Sky/Path.hdr", SkyFactory.EnvMapType.EquirectMap);
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.attachChild(pbrSky);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.attachChild(pbrSky);
+                    } else {
+                        pbrSky.removeFromParent();
+                    }
+                    return null;
+                }
+            });
+        }
+    }
 
 
     public void setPhysicsEnabled(final boolean enabled) {
     public void setPhysicsEnabled(final boolean enabled) {
         enqueue(new Callable() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
             public Object call() throws Exception {
                 if (enabled) {
                 if (enabled) {
                     if (physicsState == null) {
                     if (physicsState == null) {
@@ -636,7 +715,9 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         NotifyUtil.show("Error starting OpenGL context!", "Click here to go to troubleshooting web page.", MessageType.EXCEPTION, lst, 0);
         NotifyUtil.show("Error starting OpenGL context!", "Click here to go to troubleshooting web page.", MessageType.EXCEPTION, lst, 0);
         logger.log(Level.INFO, exception.getMessage(), exception);
         logger.log(Level.INFO, exception.getMessage(), exception);
     }
     }
+    
     private static final ActionListener lst = new ActionListener() {
     private static final ActionListener lst = new ActionListener() {
+        @Override
         public void actionPerformed(ActionEvent e) {
         public void actionPerformed(ActionEvent e) {
             try {
             try {
                 HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting"));
                 HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting"));

+ 4 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/Bundle.properties

@@ -11,3 +11,7 @@ SceneViewerTopComponent.jToggleButton2.AccessibleContext.accessibleName=Ortho /
 SceneViewerTopComponent.jToggleButton1.toolTipText=show post filter effects
 SceneViewerTopComponent.jToggleButton1.toolTipText=show post filter effects
 SceneViewerTopComponent.jToggleButton1.text=
 SceneViewerTopComponent.jToggleButton1.text=
 SceneViewerTopComponent.enableOrtho.textO=Ortho.
 SceneViewerTopComponent.enableOrtho.textO=Ortho.
+SceneViewerTopComponent.enablePBREnv.toolTipText=Toggle a PBR Environment
+SceneViewerTopComponent.enablePBREnv.text=
+SceneViewerTopComponent.enablePBRSky.toolTipText=Toggle the Skybox matching the PBR Environment (stay patient)
+SceneViewerTopComponent.enablePBRSky.text=

+ 44 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.form

@@ -96,6 +96,50 @@
             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enableWireframeActionPerformed"/>
             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enableWireframeActionPerformed"/>
           </Events>
           </Events>
         </Component>
         </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBREnv">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBREnvActionPerformed"/>
+          </Events>
+        </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBRSky">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBRSkyActionPerformed"/>
+          </Events>
+        </Component>
         <Container class="javax.swing.JPanel" name="jPanel1">
         <Container class="javax.swing.JPanel" name="jPanel1">
 
 
           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>

+ 52 - 1
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.java

@@ -47,7 +47,8 @@ import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 import org.openide.windows.WindowManager;
 
 
 /**
 /**
- * Top component which displays something.
+ * This is the component containing the whole scene/model<br />
+ * It also contains the top bar.
  */
  */
 @ConvertAsProperties(dtd = "-//com.jme3.gde.core.sceneviewer//SceneViewer//EN",
 @ConvertAsProperties(dtd = "-//com.jme3.gde.core.sceneviewer//SceneViewer//EN",
 autostore = false)
 autostore = false)
@@ -92,8 +93,10 @@ public final class SceneViewerTopComponent extends TopComponent {
         //the oGLPanel may naver have the focus.
         //the oGLPanel may naver have the focus.
         //  if ("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false"))) {
         //  if ("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false"))) {
         addMouseWheelListener(new MouseWheelListener() {
         addMouseWheelListener(new MouseWheelListener() {
+            @Override
             public void mouseWheelMoved(final MouseWheelEvent e) {
             public void mouseWheelMoved(final MouseWheelEvent e) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                     public Void call() throws Exception {
                         String action;
                         String action;
                         if (e.getWheelRotation() < 0) {
                         if (e.getWheelRotation() < 0) {
@@ -113,11 +116,14 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
             }
         });
         });
         addKeyListener(new KeyListener() {
         addKeyListener(new KeyListener() {
+            @Override
             public void keyTyped(KeyEvent evt) {
             public void keyTyped(KeyEvent evt) {
             }
             }
 
 
+            @Override
             public void keyPressed(final KeyEvent evt) {
             public void keyPressed(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
@@ -130,8 +136,10 @@ public final class SceneViewerTopComponent extends TopComponent {
                 });
                 });
             }
             }
 
 
+            @Override
             public void keyReleased(final KeyEvent evt) {
             public void keyReleased(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
@@ -161,6 +169,8 @@ public final class SceneViewerTopComponent extends TopComponent {
         jToggleButton1 = new javax.swing.JToggleButton();
         jToggleButton1 = new javax.swing.JToggleButton();
         jSeparator1 = new javax.swing.JToolBar.Separator();
         jSeparator1 = new javax.swing.JToolBar.Separator();
         enableWireframe = new javax.swing.JToggleButton();
         enableWireframe = new javax.swing.JToggleButton();
+        enablePBREnv = new javax.swing.JToggleButton();
+        enablePBRSky = new javax.swing.JToggleButton();
         jPanel1 = new javax.swing.JPanel();
         jPanel1 = new javax.swing.JPanel();
         enableStats = new javax.swing.JToggleButton();
         enableStats = new javax.swing.JToggleButton();
         oGLPanel = new javax.swing.JPanel();
         oGLPanel = new javax.swing.JPanel();
@@ -211,6 +221,34 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
             }
         });
         });
         jToolBar1.add(enableWireframe);
         jToolBar1.add(enableWireframe);
+
+        enablePBREnv.setIcon(IconList.chimpSmile);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBREnv, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.text")); // NOI18N
+        enablePBREnv.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.toolTipText")); // NOI18N
+        enablePBREnv.setFocusable(false);
+        enablePBREnv.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBREnv.setSelectedIcon(IconList.chimpSmile);
+        enablePBREnv.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBREnv.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBREnvActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBREnv);
+
+        enablePBRSky.setIcon(IconList.chimpMad);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBRSky, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.text")); // NOI18N
+        enablePBRSky.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.toolTipText")); // NOI18N
+        enablePBRSky.setFocusable(false);
+        enablePBRSky.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBRSky.setSelectedIcon(IconList.chimpMad);
+        enablePBRSky.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBRSky.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBRSkyActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBRSky);
         jToolBar1.add(jPanel1);
         jToolBar1.add(jPanel1);
 
 
         enableStats.setIcon(IconList.info);
         enableStats.setIcon(IconList.info);
@@ -248,8 +286,19 @@ public final class SceneViewerTopComponent extends TopComponent {
     private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
     private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
         FilterExplorerTopComponent.findInstance().setFilterEnabled(jToggleButton1.isSelected());
         FilterExplorerTopComponent.findInstance().setFilterEnabled(jToggleButton1.isSelected());
     }//GEN-LAST:event_jToggleButton1ActionPerformed
     }//GEN-LAST:event_jToggleButton1ActionPerformed
+
+    private void enablePBREnvActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBREnvActionPerformed
+        app.enablePBRProbe(enablePBREnv.isSelected());
+    }//GEN-LAST:event_enablePBREnvActionPerformed
+
+    private void enablePBRSkyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBRSkyActionPerformed
+        app.enablePBRSkybox(enablePBRSky.isSelected());
+    }//GEN-LAST:event_enablePBRSkyActionPerformed
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JToggleButton enableCamLight;
     private javax.swing.JToggleButton enableCamLight;
+    private javax.swing.JToggleButton enablePBREnv;
+    private javax.swing.JToggleButton enablePBRSky;
     private javax.swing.JToggleButton enableStats;
     private javax.swing.JToggleButton enableStats;
     private javax.swing.JToggleButton enableWireframe;
     private javax.swing.JToggleButton enableWireframe;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel1;
@@ -264,6 +313,7 @@ public final class SceneViewerTopComponent extends TopComponent {
      * only, i.e. deserialization routines; otherwise you could get a
      * only, i.e. deserialization routines; otherwise you could get a
      * non-deserialized instance. To obtain the singleton instance, use
      * non-deserialized instance. To obtain the singleton instance, use
      * {@link #findInstance}.
      * {@link #findInstance}.
+     * @return 
      */
      */
     public static synchronized SceneViewerTopComponent getDefault() {
     public static synchronized SceneViewerTopComponent getDefault() {
         if (instance == null) {
         if (instance == null) {
@@ -275,6 +325,7 @@ public final class SceneViewerTopComponent extends TopComponent {
     /**
     /**
      * Obtain the SceneViewerTopComponent instance. Never call
      * Obtain the SceneViewerTopComponent instance. Never call
      * {@link #getDefault} directly!
      * {@link #getDefault} directly!
+     * @return 
      */
      */
     public static synchronized SceneViewerTopComponent findInstance() {
     public static synchronized SceneViewerTopComponent findInstance() {
         TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
         TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);

BIN
jme3-core/src/com/jme3/gde/core/sceneviewer/pbrenv.j3o