@Override public void done(LightProbe result) { System.err.println("Done rendering env maps"); tex = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(result.getPrefilteredEnvMap(), assetManager); } });
@Override public void done(LightProbe result) { System.err.println("Done rendering env maps"); tex = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(result.getPrefilteredEnvMap(), assetManager); rootNode.getChild(0).setCullHint(Spatial.CullHint.Dynamic); } });
/** * For debuging porpose only * Will return a Node meant to be added to a GUI presenting the 2 cube maps in a cross pattern with all the mip maps. * * @param manager the asset manager * @return a debug node */ public static Node getDebugGui(AssetManager manager, LightProbe probe) { if (!probe.isReady()) { throw new UnsupportedOperationException("This EnvProbe is not ready yet, try to test isReady()"); } Node debugNode = new Node("debug gui probe"); Node debugPfemCm = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(probe.getPrefilteredEnvMap(), manager); debugNode.attachChild(debugPfemCm); debugPfemCm.setLocalTranslation(520, 0, 0); return debugNode; }
@Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("tex") && isPressed) { if (tex == null) { tex = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(stateManager.getState(EnvironmentCamera.class).debugEnv, assetManager); } if (tex.getParent() == null) { guiNode.attachChild(tex); } else { tex.removeFromParent(); } } if (name.equals("switch") && isPressed) { switchMat(rootNode.getChild("Scene")); } if (name.equals("ref") && isPressed) { if (ref.getParent() == null) { guiNode.attachChild(ref); } else { ref.removeFromParent(); } } } }, "tex", "switch", "ref");
/** * For debuging porpose only * Will return a Node meant to be added to a GUI presenting the 2 cube maps in a cross pattern with all the mip maps. * * @param manager the asset manager * @return a debug node */ public Node getDebugGui(AssetManager manager) { if (!ready) { throw new UnsupportedOperationException("This EnvProbe is not ready yet, try to test isReady()"); } if (debugNode == null) { debugNode = new Node("debug gui probe"); Node debugPfemCm = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(getPrefilteredEnvMap(), manager); debugNode.attachChild(debugPfemCm); debugPfemCm.setLocalTranslation(520, 0, 0); } return debugNode; }