-
Notifications
You must be signed in to change notification settings - Fork 27
Postprocessing
thothbot edited this page Oct 20, 2012
·
11 revisions
This is renderer plugin which is used to add additional rendering effects.
To use Post-processing you should do the following:
- Plugin initialization in the
AnimatedScene
instance:/* skipped */ @Override protected void onStart() { /* skipped */ Postprocessing composer = new Postprocessing( getRenderer(), getScene() ); }
- Setup RenderPass, which is needed to render current scene in the post-processor :
RenderPass renderModel = new RenderPass( getScene(), camera ); composer.addPass( renderModel );
- Disable auto-cleaning in WebGL renderer:
getRenderer().setAutoClear(false);
- Add interesting post-processor pass/es:
BloomPass effectBloom = new BloomPass( 1.3 ); ShaderPass effectCopy = new ShaderPass( new CopyShader() ); effectCopy.setRenderToScreen(true); composer.addPass( effectBloom ); composer.addPass( effectCopy );
Used to reproduce an imaging artifact of real-world cameras. The effect produces fringes (or feathers) of light around very bright objects in an image, obscuring fine details. Basically, if an object has a light behind it, the light will look more realistic and will somewhat overlap the front of the object from the 3rd person perspective.
BloomPass effect = new BloomPass( 1.3 );
composer.addPass( effect );
This pass produces an analogue noise overlay similar to a film grain / TV static
FilmPass effect = new FilmPass(
0.35, // Sets intensity of noise
0.95, // Sets intensity of scanlines
2048, // Sets number of the scanlines
false // Enable / disable gray-scale
);
composer.addPass( effect );