CartoonEdge
, Posterization
, and CrossHatch
(from the com.jme3.post.filters
package) are three examples of artistic filters. In contrast to the other photo-realistic filters, artistic filters make the 3D scene look flat and untextured, as if painted or printed.
The following screenshot shows how a toon shader makes the fiercest dinosaur look cute:
The toon effect is activated just like any other filter:
Make a copy of
Main.java
and name the classCartoon.java
. Remember to also refactor the first line of themain()
method toCartoon app = new Cartoon()
.Add three class fields: one for the scene, one for the
FilterPostProcessor
, and one for theCartoonEdgeFilter
(from thecom.jme3.post.filters
package):private Spatial sceneGeo; private FilterPostProcessor fpp; private CartoonEdgeFilter toon;
Initialize
fpp
andtoon
in thesimpleInitApp()
method. Add theFilterPostProcessor
to theviewPort
, and add theCartoonEdgeFilter
to theFilterPostProcessor
:public...