public void onAnalog(String name, float isPressed, float tpf) { if (name.equals("WhitePointUp")) { whitePointLog += tpf * 1.0; if (whitePointLog > 4f) { whitePointLog = 4f; } float wp = FastMath.exp(whitePointLog); toneMapFilter.setWhitePoint(new Vector3f(wp, wp, wp)); System.out.println("White point: " + wp); } if (name.equals("WhitePointDown")) { whitePointLog -= tpf * 1.0; if (whitePointLog < -4f) { whitePointLog = -4f; } float wp = FastMath.exp(whitePointLog); toneMapFilter.setWhitePoint(new Vector3f(wp, wp, wp)); System.out.println("White point: " + wp); } } };
public void setupHdr(){ if (renderer.getCaps().contains(Caps.GLSL100)){ toneMapFilter = new ToneMapFilter(); toneMapFilter.setWhitePoint(new Vector3f(3f, 3f, 3f)); FilterPostProcessor fpp = new FilterPostProcessor(assetManager); fpp.addFilter(toneMapFilter); viewPort.addProcessor(fpp); // setPauseOnLostFocus(false); } }