Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  where did the red fps overlay go??  (Read 3033 times)
0 Members and 1 Guest are viewing this topic.
Offline hawkwind

Junior Duke




Java games rock!


« Posted 2006-10-07 22:52:44 »

I was seeing a redish FPS counter overlay appearing on my canvas by default, this has gone away.  How do I enable/re-enable this??
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #1 - Posted 2006-10-07 23:19:31 »

I was seeing a redish FPS counter overlay appearing on my canvas by default, this has gone away.  How do I enable/re-enable this??

Which class are you talking about?
Offline hawkwind

Junior Duke




Java games rock!


« Reply #2 - Posted 2006-10-07 23:30:52 »

I have been convdrting my game to the current xith3d, render loops etc.  I had a redish/orange fps counter appearing in the upper right cornet of my game.  i was pleased as it seemed to be default behavior of using the new stuff.  Now it no longer appears.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #3 - Posted 2006-10-07 23:42:23 »

I have been convdrting my game to the current xith3d, render loops etc.  I had a redish/orange fps counter appearing in the upper right cornet of my game.  i was pleased as it seemed to be default behavior of using the new stuff.  Now it no longer appears.

hmm... Can't remember, when it was default to display an FPS counter on the screen. Which version are you coming from?

But you can use the one provided by the HUD system. Have a look at org.xith3d.test.animation.RotatableGroupTest. It is used there. But please make a fresh checkout of you CVS. I've just moved it.

Marvin
Offline hawkwind

Junior Duke




Java games rock!


« Reply #4 - Posted 2006-10-07 23:57:29 »

wierd...I wonder who/what was dispalying this.   I tried the HUD based one a bit ago but none of the rest of my scene appeared...I will retry
Offline rafa_es

Junior Duke





« Reply #5 - Posted 2006-10-08 00:04:41 »

wierd...I wonder who/what was dispalying this.   I tried the HUD based one a bit ago but none of the rest of my scene appeared...I will retry

A similar issue occurs in my scene
When i put HUD on my scene the SkyBox is not displayed and when i take it off it's displayed again, but the rest of the scene loads fine
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #6 - Posted 2006-10-08 00:19:28 »

A similar issue occurs in my scene
When i put HUD on my scene the SkyBox is not displayed and when i take it off it's displayed again, but the rest of the scene loads fine

Do you handle the multipass rendering correctly? Do it like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
BranchGroup mainBranch = new BranchGroup();
env.addBranchGraph( mainBranch, new RenderPassConfig(RenderPassConfig.PERSPECTIVE_PROJECTION) ); // must be added before the hudBranch or with index

BranchGroup hudBranch = new BranchGroup();
env.addBranchGraph( hudBranch, new RenderPassConfig(RenderPassConfig.PARALLEL_PROJECTION) ); // must be added last or with index

// add your scene stuff to the appropriate branch
mainBranch.addChild( new Skybox( ... ) );
mainBranch.addChild( new Shape3D( ... ) );

// add your HUD stuff to the appropriate branch
hudBranch.addChild( new HUD( ... ) );


Marvin
Offline hawkwind

Junior Duke




Java games rock!


« Reply #7 - Posted 2006-10-08 00:25:47 »

I think I missed the render pass thing before adding the HUD...laptop died....power cords are at home.  I will retyr sunday.

So depressed that the FPS thing disappered, I am seeing a 4X FPS improvement, of course this is based on the mysterious disappearing reddish FPS text. so who knows what was being measured by whom.

On a side note, I noticed all of my OLD UI based windows no longer aligh parralell to the screen, they rotate along with the view rotation...kinda cool...I assume this is a subtle push to hellp people decide to convert to the new HUD system...Smiley
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #8 - Posted 2006-10-08 00:34:27 »

I think I missed the render pass thing before adding the HUD...laptop died....power cords are at home.  I will retyr sunday.

So depressed that the FPS thing disappered, I am seeing a 4X FPS improvement, of course this is based on the mysterious disappearing reddish FPS text. so who knows what was being measured by whom.

On a side note, I noticed all of my OLD UI based windows no longer aligh parralell to the screen, they rotate along with the view rotation...kinda cool...I assume this is a subtle push to hellp people decide to convert to the new HUD system...Smiley

I don't know the old UI system. Are you talking about the Swing overlay? Never worked with it. Again: From which version are you coming from?
Offline rafa_es

Junior Duke





« Reply #9 - Posted 2006-10-08 00:40:11 »

I'm doing like this Marvin

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
    private void createSceneGraph(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Xith3DDemoFolder demoFolder) throws Exception {
   
        // Adicona a cena ao ambiente e seta a renderização por perspectiva
        env.addChild(scene);  

        env.addRenderPass( new RenderPass(env.getRootGroup(), passConfig) );
        ...

       scene.addChild(world);
       scene.addChild(skybox);
      }


And the HUD  like this
1  
2  
3  
4  
5  
6  
7  
8  
private void createHUD(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Canvas3D canvas, Xith3DDemoFolder demoFolder) throws Exception
    {
        BranchGroup hudBranch = new BranchGroup();
       
        env.addRenderPass( new RenderPass(hudBranch, passConfig) );
        .....
       hudBranch.addChild(hud);
    }


Am i doing something wrong?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #10 - Posted 2006-10-08 00:53:08 »

I'm doing like this Marvin

1  
...


Am i doing something wrong?

Well... First of all, never use env.addChild(), when you're using multipass rendering. I'll add a note on it to the JavaDoc.

The second code-quote was not complete. But I'll assume the rest. Do it like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
    private void createSceneGraph(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Xith3DDemoFolder demoFolder) throws Exception {
   
   BranchGroup sceneBanch = new BranchGroup();
   
        scene.addChild(skybox);
        scene.addChild(world);
        sceneBranch.addChild( scene );
   
        env.addBranchGraph( sceneBranch, passConfig );
      }


And the HUD  like this
1  
2  
3  
4  
5  
6  
7  
8  
private void createHUD(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Canvas3D canvas, Xith3DDemoFolder demoFolder) throws Exception
    {
        BranchGroup hudBranch = new BranchGroup();
       
        env.addBranchGraph( hudBranch, passConfig );
        .....
       hudBranch.addChild(hud);
    }


Alternatively to env.addBranchGraph( BranchGroup, RenderPassConfigProvider) you can also use env.addBranchGraph( BranchGroup ) and env.addRenderPass( RenderPass) just like you did in your createHUD method. But I guess, this is easier, isn't it?

Marvin

EDIT: I also assumed, your scene variable is not a BranchGroup. And that the RenderPassConfigProvider parameters are corretly filled with PERSPECTIVE and PARALLEL projection values.
Offline hawkwind

Junior Duke




Java games rock!


« Reply #11 - Posted 2006-10-08 01:18:02 »

Yup I was using the old swing overlays...I am using the most current CVS source these days. 

I am not complaining by the way, it was interesting to see the same old set of windows suddenly start streching and rotating.   I have been driving all day..5 hours up to the Mountains and 5 back.  Had to rub my eyes several times when the windows moved.. I intend to convert to the HUD stuff and drop the swing stuff.
Offline rafa_es

Junior Duke





« Reply #12 - Posted 2006-10-08 01:21:07 »

I don't know if i am missing something but heres is the full code

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
    private void createSceneGraph(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Xith3DDemoFolder demoFolder) throws Exception {
   
        BranchGroup sceneBranch = new BranchGroup();
       
        TransformGroup world;
       
        AseFile af = new AseFile();
   BufferedReader br = null;

        try {
            br = new BufferedReader(new FileReader("src/models/Sala.ASE"));
   } catch (IOException e) {
            URL url = this.getClass().getClassLoader().getResource("src/models/Sala.ASE");
            br = new BufferedReader(new InputStreamReader(url.openStream()));
   }

        AseReader r = new AseReader(br, af);
   af.parse(r);
     
   Map<String, Node> namedNodes = new HashMap<String, Node>();
     
   world = af.getTransformGroupTree(namedNodes);
       
        scene.addChild(world);

        String top = "src/Textures/top.PNG";
        String left = "src/Textures/left.PNG";
        String back = "src/Textures/back.PNG";
        String front = "src/Textures/front.PNG";
        String right = "src/Textures/right.PNG";
        String bottom = "src/Textures/bottom.PNG";
       
        SkyBox skybox = new SkyBox(front, left, back, right, top, bottom);
       
        scene.addChild(skybox);

        AmbientLight light = new AmbientLight(true,new Color3f(0.95f, 0.95f, 0.95f));
       
        scene.addChild(light);

        sceneBranch.addChild(scene);
       
        env.addBranchGraph( sceneBranch, passConfig );
    }


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
    private void createHUD(ExtXith3DEnvironment env, RenderPassConfigProvider passConfig, Canvas3D canvas, Xith3DDemoFolder demoFolder) throws Exception
    {
        BranchGroup hudBranch = new BranchGroup();

        env.addBranchGraph( hudBranch, passConfig );  
       
        HUD hud = new HUD(canvas, 800, 600, this);
       
        Image crosshair = new Image(hud.getSizeOfPixels(32, 32), "src/Textures/CrosshairWhite.png", true);
        hud.addWidget(crosshair, (hud.getResolution().x - crosshair.getWidth()) / 2f, (hud.getResolution().y - crosshair.getHeight()) / 2f);

        FPSCounter fpsCounter = new FPSCounter(100, 30, "src/Textures/YellowBorder.png");
        fpsCounter.setFontColor( new Color3f(0.12f, 1.0f, 0.18f) );
        this.addFPSListener(fpsCounter);
        hud.addWidget(fpsCounter, 50, 15);        
       
        hudBranch.addChild(hud);
    }


and they are called this way

1  
2  
        createSceneGraph(env, new RenderPassConfig(RenderPassConfig.PERSPECTIVE_PROJECTION), demoFolder);
        createHUD(env, new RenderPassConfig(RenderPassConfig.PARALLEL_PROJECTION), canvas, demoFolder);  


If i comment the create HUD method call the skybox works fine but if it's uncommented it dosen't appear
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #13 - Posted 2006-10-08 01:40:10 »

ok. I checked it. And I get the same behaviour. Must be something in the multipass rendering code. I'll fix it soon. OK?
Offline rafa_es

Junior Duke





« Reply #14 - Posted 2006-10-08 01:46:22 »

ok. I checked it. And I get the same behaviour. Must be something in the multipass rendering code. I'll fix it soon. OK?

Ok, Should you post here when you fix so i can update the cvs?
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #15 - Posted 2006-10-08 01:48:04 »

Ok, Should you post here when you fix so i can update the cvs?

I will.
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #16 - Posted 2006-10-08 02:41:00 »

ok. I checked it. And I get the same behaviour. Must be something in the multipass rendering code. I'll fix it soon. OK?

fixed.
Offline rafa_es

Junior Duke





« Reply #17 - Posted 2006-10-08 13:56:03 »

ok. I checked it. And I get the same behaviour. Must be something in the multipass rendering code. I'll fix it soon. OK?

fixed.

Thanks for the help Marvin, now it's running fine  Grin
Offline Marvin Fröhlich

Senior Duke




May the 4th, be with you...


« Reply #18 - Posted 2006-10-08 14:04:21 »

Thanks for the help Marvin, now it's running fine  Grin

You're welcome Smiley
Offline Amos Wenger

Senior Duke




Everything's possible, but not everything's fun...


« Reply #19 - Posted 2006-10-09 16:28:25 »

Yup I was using the old swing overlays...I am using the most current CVS source these days. 

I am not complaining by the way, it was interesting to see the same old set of windows suddenly start streching and rotating.   I have been driving all day..5 hours up to the Mountains and 5 back.  Had to rub my eyes several times when the windows moved.. I intend to convert to the HUD stuff and drop the swing stuff.
I use the Swing GUI and it works just fine (though I'll convert it to the HUD when I have time to).

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (32 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (58 views)
2014-10-16 15:22:06

Norakomi (47 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!