added SSAO and FXAA
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.post.FilterPostProcessor;
|
import com.jme3.post.FilterPostProcessor;
|
||||||
|
import com.jme3.post.filters.FXAAFilter;
|
||||||
|
import com.jme3.post.ssao.SSAOFilter;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.shadow.DirectionalLightShadowFilter;
|
import com.jme3.shadow.DirectionalLightShadowFilter;
|
||||||
import com.jme3.shadow.EdgeFilteringMode;
|
import com.jme3.shadow.EdgeFilteringMode;
|
||||||
@@ -37,6 +39,8 @@ public class CameraHandler {
|
|||||||
private Color ownColor;
|
private Color ownColor;
|
||||||
private boolean init;
|
private boolean init;
|
||||||
private boolean initRot;
|
private boolean initRot;
|
||||||
|
private SSAOFilter ssaoFilter;
|
||||||
|
private FXAAFilter fxaaFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for the CameraHandler. Initializes the camera settings and lighting.
|
* Constructor for the CameraHandler. Initializes the camera settings and lighting.
|
||||||
@@ -65,6 +69,9 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp) {
|
|||||||
dlsf.setEnabled(true);
|
dlsf.setEnabled(true);
|
||||||
dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
|
dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
|
||||||
dlsf.setShadowIntensity(0.7f);
|
dlsf.setShadowIntensity(0.7f);
|
||||||
|
ssaoFilter = new SSAOFilter(6, 10f, 0.33f, 0.61f);
|
||||||
|
// ssaoFilter = new SSAOFilter();
|
||||||
|
fxaaFilter = new FXAAFilter();
|
||||||
|
|
||||||
sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI*1,0,FastMath.HALF_PI*0.2f);
|
sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI*1,0,FastMath.HALF_PI*0.2f);
|
||||||
|
|
||||||
@@ -82,6 +89,8 @@ public void init(Color ownColor) {
|
|||||||
app.getRootNode().addLight(ambient);
|
app.getRootNode().addLight(ambient);
|
||||||
app.getRootNode().attachChild(sky);
|
app.getRootNode().attachChild(sky);
|
||||||
fpp.addFilter(dlsf);
|
fpp.addFilter(dlsf);
|
||||||
|
fpp.addFilter(ssaoFilter);
|
||||||
|
fpp.addFilter(fxaaFilter);
|
||||||
init = true;
|
init = true;
|
||||||
initRot = true;
|
initRot = true;
|
||||||
this.ownColor = ownColor;
|
this.ownColor = ownColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user