/** * fades the scene out (scene to black) */ public void fadeOut() { setEnabled(true); direction = -1; playing = true; }
/** * Sets the downSampling factor : the size of the computed texture will be divided by this factor. default is 1 for no downsampling * A 2 value is a good way of widening the blur * @param downSamplingFactor */ public void setDownSamplingFactor(float downSamplingFactor) { this.downSamplingFactor = downSamplingFactor; if (assetManager != null) // dirty isInitialised check reInitFilter(); }
public static FogFilter cloneFogFilter(FogFilter fogFilter){ FogFilter filterClone = new FogFilter(); filterClone.setFogColor(fogFilter.getFogColor()); filterClone.setFogDensity(fogFilter.getFogDensity()); filterClone.setFogDistance(fogFilter.getFogDistance()); filterClone.setName(fogFilter.getName() + " Clone"); return filterClone; }
@Override protected void setDepthTexture(Texture depthTexture) { this.depthTexture = depthTexture; if (enabledSoftParticles && depthTexture != null) { initSoftParticles(viewPort, true); } }
public GammaCorrectionFilter(float gamma) { this(); this.setGamma(gamma); }
@Override public void onPlay() { fade.setDuration(1f / cinematic.getSpeed()); if (in) { fade.fadeIn(); } else { fade.fadeOut(); } fade.setValue(value); }
private void initSoftParticles(ViewPort vp, boolean enabledSP) { if (depthTexture != null) { for (Spatial scene : vp.getScenes()) { makeSoftParticleEmitter(scene, enabledSP && enabled); } } }
public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("press") && isPressed) { if (filterEnabled) { viewPort.removeProcessor(fpp); view2.removeProcessor(fpp2); view3.removeProcessor(fpp3); view4.removeProcessor(fpp4); view5.removeProcessor(fpp5); } else { viewPort.addProcessor(fpp); view2.addProcessor(fpp2); view3.addProcessor(fpp3); view4.addProcessor(fpp4); view5.addProcessor(fpp5); } filterEnabled = !filterEnabled; } if (name.equals("filter") && isPressed) { ff.setEnabled(!ff.isEnabled()); rbf.setEnabled(!rbf.isEnabled()); } } }, "press", "filter");
protected void reInitFilter() { initFilter(assetManager, renderManager, viewPort, initalWidth, initalHeight); }
public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) { if (name.equals("toggle")) { dofFilter.setEnabled(!dofFilter.isEnabled()); } } } }, "toggle");
public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { pf.setEnabled(!pf.isEnabled()); } } };
@Override public void setTime(float time) { super.setTime(time); if (time >= fade.getDuration()) { value = in ? 1 : 0; fade.setValue(value); } else { value = time; if (in) { fade.setValue(time / cinematic.getSpeed()); } else { fade.setValue(1 - time / cinematic.getSpeed()); } } }
public void setupFilters() { if (renderer.getCaps().contains(Caps.GLSL100)) { fpp = new FilterPostProcessor(assetManager); // fpp.setNumSamples(4); // fpp.setNumSamples(4); //fpp.addFilter(new ColorOverlayFilter(ColorRGBA.LightGray)); fpp.addFilter(new RadialBlurFilter()); fade = new FadeFilter(1.0f); fpp.addFilter(fade); viewPort.addProcessor(fpp); } }
public void onStop(CinematicEvent cinematic) { chaseCam.setEnabled(true); fade.setValue(1); System.out.println("stop"); } });
private void setupFilter() { FilterPostProcessor fpp = new FilterPostProcessor(assetManager); BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.Objects); fpp.addFilter(bloom); viewPort.addProcessor(fpp); }
@Override protected void cleanUpFilter(Renderer r) { if (renderManager != null) { renderManager.setHandleTranslucentBucket(true); } initSoftParticles(viewPort, false); }
/** * fades the scene in (black to scene) */ public void fadeIn() { setEnabled(true); direction = 1; playing = true; }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (renderManager != null) { renderManager.setHandleTranslucentBucket(!enabled); } initSoftParticles(viewPort, enabledSoftParticles); }