preGlowPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth); extractPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth, 1, extractMat); postRenderPasses.add(extractPass); horizontalBlur.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth, 1, hBlurMat); postRenderPasses.add(horizontalBlur); verticalalBlur.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth, 1, vBlurMat); postRenderPasses.add(verticalalBlur);
@Override protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { this.renderManager = renderManager; this.viewPort = vp; int screenWidth = Math.round(w / downsample); int screenHeight = Math.round(h / downsample); normalPass = new Pass(); normalPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth); frustumNearFar = new Vector2f(); float farY = (vp.getCamera().getFrustumTop() / vp.getCamera().getFrustumNear()) * vp.getCamera().getFrustumFar(); float farX = farY * ((float) screenWidth / (float) screenHeight); frustumCorner = new Vector3f(farX, farY, vp.getCamera().getFrustumFar()); frustumNearFar.x = vp.getCamera().getFrustumNear(); frustumNearFar.y = vp.getCamera().getFrustumFar(); //ssao Pass material = new Material(manager, "Common/MatDefs/VR/CartoonSSAO.j3md"); material.setTexture("Normals", normalPass.getRenderedTexture()); material.setVector3("FrustumCorner", frustumCorner); material.setVector2("FrustumNearFar", frustumNearFar); material.setFloat("Distance", applyDistance); if( useOutline == false ) material.setBoolean("disableOutline", true); if( instancedRendering ) material.setBoolean("useInstancing", true); }
normalPass.init(renderManager.getRenderer(), (int) (screenWidth / downSampleFactor), (int) (screenHeight / downSampleFactor), Format.RGBA8, Format.Depth); ssaoPass.init(renderManager.getRenderer(), (int) (screenWidth / downSampleFactor), (int) (screenHeight / downSampleFactor), Format.RGBA8, Format.Depth, 1, ssaoMat);
public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSamples) { init(renderer, width, height, textureFormat, depthBufferFormat, numSamples, false); }
@Override protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { this.renderManager = renderManager; this.viewPort = vp; normalPass = new Pass(); normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth); material = new Material(manager, "Common/MatDefs/Post/CartoonEdge.j3md"); material.setFloat("EdgeWidth", edgeWidth); material.setFloat("EdgeIntensity", edgeIntensity); material.setFloat("NormalThreshold", normalThreshold); material.setFloat("DepthThreshold", depthThreshold); material.setFloat("NormalSensitivity", normalSensitivity); material.setFloat("DepthSensitivity", depthSensitivity); material.setColor("EdgeColor", edgeColor); }
@Override protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { this.renderManager = renderManager; this.viewPort = vp; normalPass = new Pass(); normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth); material = new Material(manager, "Common/MatDefs/Post/CartoonEdge.j3md"); material.setFloat("EdgeWidth", edgeWidth); material.setFloat("EdgeIntensity", edgeIntensity); material.setFloat("NormalThreshold", normalThreshold); material.setFloat("DepthThreshold", depthThreshold); material.setFloat("NormalSensitivity", normalSensitivity); material.setFloat("DepthSensitivity", depthSensitivity); material.setColor("EdgeColor", edgeColor); }
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
/** * * initialize this filter * use InitFilter for overriding filter initialization * @param manager the assetManager * @param renderManager the renderManager * @param vp the viewport * @param w the width * @param h the height */ protected final void init(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { // cleanup(renderManager.getRenderer()); defaultPass = new Pass(); defaultPass.init(renderManager.getRenderer(), w, h, getDefaultPassTextureFormat(), getDefaultPassDepthFormat()); initFilter(manager, renderManager, vp, w, h); }
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
/** * init the pass called internally * @param renderer * @param width * @param height * @param textureFormat * @param depthBufferFormat * @param numSample * @param material */ public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSample, Material material) { init(renderer, width, height, textureFormat, depthBufferFormat, numSample); passMaterial = material; }
public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSamples) { init(renderer, width, height, textureFormat, depthBufferFormat, numSamples, false); }
/** * init the pass called internally * @param renderer * @param width * @param height * @param textureFormat * @param depthBufferFormat */ public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat) { init(renderer, width, height, textureFormat, depthBufferFormat, 1); }
/** * init the pass called internally * @param renderer * @param width * @param height * @param textureFormat * @param depthBufferFormat */ public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat) { init(renderer, width, height, textureFormat, depthBufferFormat, 1); }
this.viewPort = vp; reflectionPass = new Pass(); reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam = new Camera(reflectionMapSize, reflectionMapSize); reflectionView = new ViewPort("reflectionView", reflectionCam);
/** * init the pass called internally * @param renderer * @param width * @param height * @param textureFormat * @param depthBufferFormat * @param numSample * @param material */ public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSample, Material material) { init(renderer, width, height, textureFormat, depthBufferFormat, numSample); passMaterial = material; }
/** * * initialize this filter * use InitFilter for overriding filter initialization * @param manager the assetManager * @param renderManager the renderManager * @param vp the viewport * @param w the width * @param h the height */ protected final void init(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { // cleanup(renderManager.getRenderer()); defaultPass = new Pass(); defaultPass.init(renderManager.getRenderer(), w, h, getDefaultPassTextureFormat(), getDefaultPassDepthFormat()); initFilter(manager, renderManager, vp, w, h); }
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
@Override protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { this.renderManager = renderManager; this.viewPort = vp; normalPass = new Pass(); normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth); material = new Material(manager, "Common/MatDefs/Post/CartoonEdge.j3md"); material.setFloat("EdgeWidth", edgeWidth); material.setFloat("EdgeIntensity", edgeIntensity); material.setFloat("NormalThreshold", normalThreshold); material.setFloat("DepthThreshold", depthThreshold); material.setFloat("NormalSensitivity", normalSensitivity); material.setFloat("DepthSensitivity", depthSensitivity); material.setColor("EdgeColor", edgeColor); }
public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSamples) { init(renderer, width, height, textureFormat, depthBufferFormat, numSamples, false); }
/** * init the pass called internally * @param renderer * @param width * @param height * @param textureFormat * @param depthBufferFormat */ public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat) { init(renderer, width, height, textureFormat, depthBufferFormat, 1); }