Canvas Resize – Some Update? (50 posts)

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 6 months ago:

    Hello,

    I use JME3.0 within a Netbeans framework, i.e. Swing environment. My Canvas is part of a JInternalFrame of a JDesktop pane. Works pretty good. I can remember in JME 2.0 you had to reset the settings if the canvas resized to tell the engine to use the new width and height. This was important for picking etc.
    Is there something to do in JME3.0?

    Short: What do I have to do to keep everything in the render queue up to date after my canvas has been resized?

    Thanks.

    Regards,
    Equi

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year, 6 months ago:

    The canvas should handle resizing automatically. The canvas context will defer resize events down to the rendermanager level to resize all the cameras and such.

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 6 months ago:

    Ok, thanks.

  • Profile picture of oOMoeOo oOMoeOo3p said 1 year, 4 months ago:

    Hello,

    i know that this question has be answered a time ago, but i’ve another problem while resizing the canvas. The constellation is the same like Equilibrium wrote, but in addition a FilterPostProcessor is attached to the main viewport. I tested resizing without a FilterPostProcessor attached and it worked very well. But since i’ve attached the processor the resize process will encounter a black screen. Removing it from the scene processor system will solve the problem but i definitely have to make use of that processor ;-) Any ideas what the solution could be?

    Regards
    Moe

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 4 months ago:

    Hello,

    I have got the same problem. It is all the same with all FilterPostProcessors and all Filters. I can also not use BloomFilter in a Swing environment although BloomFilter works in normal application mode.
    It has something to do with the rendering in swing environment. I already asked for solving the problem especially with BloomFilter and the JME3 guys answered that they will look for it. You have to wait until it is solved. Don’t use FilterPostProcessor until problem is solved. It doesn’t work anyway with any filter.

    Regards,
    Equi

  • Profile picture of oOMoeOo oOMoeOo3p said 1 year, 4 months ago:

    Thanks for the answer…

    I’ve already noticed that it doesn’t work with the FilterPostProcessor attached. In the moment i solved the problem by detaching the processor each time a resize event was requested. Works, but isn’t a good solution i think. Another problem is that attaching the FilterPostProcessor and rendering without a filter added will disable the complete rendering pipeline. Hope that is due to my current implementation ;-)

    Regards
    Moe

  • Profile picture of nehon nehon590p said 1 year, 4 months ago:

    You guys really know how to put the pressure :p
    @oOMoeOo Could you provide a test case for the issue?

    The second issue (disabling rendering pipeline when there are no filter) should not happen, there again could you provide a reproducible test case?

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 4 months ago:

    Hello,

    no pressure at all :-)
    I just want to have the BloomFilter, BloomFilter, BloomFilter… :-)

    Regards,
    Equi

  • Profile picture of oOMoeOo oOMoeOo3p said 1 year, 4 months ago:

    Well, putting the pressure wasn’t my intent ;-)

    I checked the second issue again and now it seems to work. We visualize software and currently switching from jme2 to jme3. For this step i’m implementing a handling to add and remove different filters dynamically and during the development process i noticed that adding a filter post processor without having one filter enabled will cause a black screen. The current implementation contains much concurrent steps. Could have been a synchronization prob. In the moment it seems to work ;-) if i can reproduce it i’ll post it here.

    The first problem is much easier to reproduce. Just have a look at the startApp-method from test.awt.TestCanvas. If you set the frame resizable, add the FilterPostProcessor and maybe a SSAOFilter, execute it and try to resize the frame, the canvas will become black. In addition i think that there is a cursor update missing after reentering the canvas. The cursor is still represented by an arrow if you quickly slowly move the mouse from outside the frame inside the canvas.

    public static void startApp(){
            app.startCanvas();
            app.enqueue(new Callable<Void>(){
                public Void call(){
                    if (app instanceof SimpleApplication){
                        SimpleApplication simpleApp = (SimpleApplication) app;
                        simpleApp.getFlyByCamera().setDragToRotate(true);
                        FilterPostProcessor proc = new FilterPostProcessor(simpleApp.getAssetManager());
                        proc.addFilter(new SSAOFilter());
                        simpleApp.getViewPort().addProcessor(proc);
                    }
                    return null;
                }
            });
        }

    Regards
    Moe

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 4 months ago:

    Which kind of application do you program? I also used JME2 but JME3 is much better.

  • Profile picture of oOMoeOo oOMoeOo3p said 1 year, 4 months ago:

    Well I’m part of a research group in germany. We’re visualizing object oriented software projects. In java context that means classes are buildings, packages are streets, subpackages are substreets, coupling degrees are edges and so one. Hope the picture explains it much better ;-)

    What about you?

    Moe

  • Profile picture of Equilibrium Equilibrium3p said 1 year, 4 months ago:

    I am from Austria. I am programming a scientific suite for molecule building, cyrstals, molecular dynamics…scientific stuff but for private use and fun only…

  • Profile picture of oOMoeOo oOMoeOo3p said 1 year, 4 months ago:

    Sound really interesting, we’re also do it for private use but switching to JME3 will be a great step. Hope that stereo processing will added soon ;-)

  • Profile picture of nehon nehon590p said 1 year, 4 months ago:

    ok thanks for the test case i’m gonna look at this ;)

  • Profile picture of nehon nehon590p said 1 year, 4 months ago:

    Committed a fix in last SVN, Filters resize properly.
    However there is still an issue with SSAO and CartoonEdge filters when resizing.

    @Equilibrium I can’t reproduce your problem , bloom works properly in a canvas. Do you have some particles or bitmap text in your scene?