Canvas renderer resizing BIG issue

Dear friends,

I'm facing big issues on canvas resizing and i'm wondering what the heck it could be :slight_smile:

I'm currently developing a CityGML viewer based on JME2 and it is quite complete as you can see in the following attached image:

It is mainly a JME2 LWJGL-based Canvas embedded in a Swing application and i use

            ((AWTGLCanvas) canvas).addComponentListener(new ComponentAdapter() {
                public void componentResized(ComponentEvent ce)

to track down size modifications.

doResize is really simple as it simply pass new size to resizeCanvas

    protected void doResize()
        int w =  ((AWTGLCanvas) canvas).getWidth();
        int h = ((AWTGLCanvas) canvas).getHeight();
        impl.resizeCanvas(w, h);

well the result is the following:

Seems like resolution is double than the specified but debugging seems everything is ok...
Tried to dig into the forum but nothing :(
Any suggestion?

Tried to disable additional features…

Found the answer in the DepthOfFieldRenderPass

        dofPass = new DepthOfFieldRenderPass(cam, 1);
        if (!dofPass.isSupported())
  "GLSL Not supported on this computer.");

commenting out this code everything is working again...
does anyone know how to fix this?


I don't think the Depth of Field render pass supports changing the display size. If you look at the source, the initialization is heavily dependent on on the display settings. You may be able to modify it to allow a dimension change, but I do not know how difficult that will be, or how it may adversely affect performance. You could always try though!

Make sure you update the camera frustum after you resize the canvas…

(I think this is not automated so that ppl can choose how they want the viewport to change…)

Thanks for pointing me at the right direction :slight_smile:

I'll keep investigating… Stay tuned! :smiley: