- add serialization to DepthOfFieldFilter (thanks to @rectalogic)
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9679 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
abfc4d6c45
commit
c842eefb90
@ -32,10 +32,15 @@
|
||||
package com.jme3.post.filters;
|
||||
|
||||
import com.jme3.asset.AssetManager;
|
||||
import com.jme3.export.InputCapsule;
|
||||
import com.jme3.export.JmeExporter;
|
||||
import com.jme3.export.JmeImporter;
|
||||
import com.jme3.export.OutputCapsule;
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.post.Filter;
|
||||
import com.jme3.renderer.RenderManager;
|
||||
import com.jme3.renderer.ViewPort;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* A post-processing filter that performs a depth range
|
||||
@ -155,4 +160,22 @@ public class DepthOfFieldFilter extends Filter {
|
||||
public float getBlurScale() {
|
||||
return blurScale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JmeExporter ex) throws IOException {
|
||||
super.write(ex);
|
||||
OutputCapsule oc = ex.getCapsule(this);
|
||||
oc.write(blurScale, "blurScale", 1f);
|
||||
oc.write(focusDistance, "focusDistance", 50f);
|
||||
oc.write(focusRange, "focusRange", 10f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(JmeImporter im) throws IOException {
|
||||
super.read(im);
|
||||
InputCapsule ic = im.getCapsule(this);
|
||||
blurScale = ic.readFloat("blurScale", 1f);
|
||||
focusDistance = ic.readFloat("focusDistance", 50f);
|
||||
focusRange = ic.readFloat("focusRange", 10f);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user