Filters have now a displayDebug method called adfter the filter has been rendered
git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@10978 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
9708a41f15
commit
db3f3c16d2
@ -64,11 +64,12 @@ public abstract class Filter implements Savable {
|
|||||||
|
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
protected Pass defaultPass;
|
protected Filter.Pass defaultPass;
|
||||||
protected List<Pass> postRenderPasses;
|
protected List<Filter.Pass> postRenderPasses;
|
||||||
protected Material material;
|
protected Material material;
|
||||||
protected boolean enabled = true;
|
protected boolean enabled = true;
|
||||||
protected FilterPostProcessor processor;
|
protected FilterPostProcessor processor;
|
||||||
|
protected boolean debug;
|
||||||
|
|
||||||
public Filter(String name) {
|
public Filter(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -234,7 +235,7 @@ public abstract class Filter implements Savable {
|
|||||||
*/
|
*/
|
||||||
protected final void init(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
|
protected final void init(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
|
||||||
// cleanup(renderManager.getRenderer());
|
// cleanup(renderManager.getRenderer());
|
||||||
defaultPass = new Pass();
|
defaultPass = new Filter.Pass();
|
||||||
defaultPass.init(renderManager.getRenderer(), w, h, getDefaultPassTextureFormat(), getDefaultPassDepthFormat());
|
defaultPass.init(renderManager.getRenderer(), w, h, getDefaultPassTextureFormat(), getDefaultPassDepthFormat());
|
||||||
initFilter(manager, renderManager, vp, w, h);
|
initFilter(manager, renderManager, vp, w, h);
|
||||||
}
|
}
|
||||||
@ -249,8 +250,8 @@ public abstract class Filter implements Savable {
|
|||||||
defaultPass.cleanup(r);
|
defaultPass.cleanup(r);
|
||||||
}
|
}
|
||||||
if (postRenderPasses != null) {
|
if (postRenderPasses != null) {
|
||||||
for (Iterator<Pass> it = postRenderPasses.iterator(); it.hasNext();) {
|
for (Iterator<Filter.Pass> it = postRenderPasses.iterator(); it.hasNext();) {
|
||||||
Pass pass = it.next();
|
Filter.Pass pass = it.next();
|
||||||
pass.cleanup(r);
|
pass.cleanup(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -411,7 +412,7 @@ public abstract class Filter implements Savable {
|
|||||||
* returns the list of the postRender passes
|
* returns the list of the postRender passes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected List<Pass> getPostRenderPasses() {
|
protected List<Filter.Pass> getPostRenderPasses() {
|
||||||
return postRenderPasses;
|
return postRenderPasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,4 +443,37 @@ public abstract class Filter implements Savable {
|
|||||||
protected void setProcessor(FilterPostProcessor proc) {
|
protected void setProcessor(FilterPostProcessor proc) {
|
||||||
processor = proc;
|
processor = proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return true if this filter is in debug mode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isDisplayDebug() {
|
||||||
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set to true if you want this filtre in debig mode.
|
||||||
|
* The method displayDebug will be called by the FilterPostProcessor after
|
||||||
|
* the filter has been rendered.allowing you to output anything.
|
||||||
|
* @param displayDebug
|
||||||
|
*/
|
||||||
|
public void setDisplayDebug(boolean displayDebug) {
|
||||||
|
this.debug = displayDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* internal use only
|
||||||
|
*/
|
||||||
|
protected void outputdebug(){
|
||||||
|
if(debug){
|
||||||
|
displayDebug();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* override this method if you want to diplay some debugging info on screen.
|
||||||
|
*/
|
||||||
|
protected void displayDebug(){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -280,6 +280,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
renderProcessing(r, buff, mat);
|
renderProcessing(r, buff, mat);
|
||||||
|
filter.outputdebug();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user