Offset viewport and filter post processor

I’ve starting using offset viewports for my project and have noticed unusual cropping when a FPP is applied. To rule out any project specific issue, I tried the same thing in TestCartoonEdge and the results were the same.

This is the code I added to TestCartoonEdge:

public void simpleInitApp() {
    cam.setViewPort(0.15f, 1.15f, 0f, 1f);

This is the result:

Then I commented out the following:

    public void setupFilters(){
    if (renderer.getCaps().contains(Caps.GLSL100)){
        fpp=new FilterPostProcessor(assetManager);
        int numSamples = getContext().getSettings().getSamples();
        if( numSamples > 0 ) {
        CartoonEdgeFilter toon=new CartoonEdgeFilter();
        //viewPort.addProcessor(fpp); <- don't add FPP

And this was the result:

So it seems the FPP causes an issue with offset viewports, visibly cropping them. Is there any way to work around this? For my project I absolutely need to have the viewport offset so that the center of the viewport is off-centered on the monitor displaying the app.


If I run the modified TestCartoonEdge in full-screen mode the issue is corrected after I minimize/maximize the app,

1 Like

looks like currently noone know issue.

i might be wrong, but i thought value 0f → 1f is min/max for viewPort. and i see 0.15f, 1.15f, 0f, 1f

maybe filter have issue because of it?

in other case you could just prepare testcase so it would be easier for clever people to see what is wrong.

The test case is what I posted above. Slight modification to the “TestCartoonEdge” class in the jme3-examples project.

have you tried using values like:

0.15f, 1f, 0f, 1f ? is there also cropping? (i know its not the same, but just to check)

This works fine. I’ve only seen the issue when the viewport is partially off-screen.