Author Topic: Performance Loss With Rendering 3D-2D-3D  (Read 1950 times)

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Performance Loss With Rendering 3D-2D-3D
« on: April 24, 2009, 04:23:40 am »
I'm writing a 2.5D RPG engine and sometimes a 2D object will have to be in front of some 3D ones, and behind others. I expect I'll draw the FrameBuffer, then get its graphics and draw the 2D object, then set all the behind 3D objects to invisible and draw the buffer again. Is that insanely slow? And Egon, a small request: World.setAllVisible(boolean), so that I need not know what's added to the world to set everything to invisible.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Performance Loss With Rendering 3D-2D-3D
« Reply #1 on: April 24, 2009, 07:29:40 am »
Using the software renderer? It should work fine, but drawing alone doesn't cut it. You have to do the whole renderScene()/draw()-process two times, once before the 2D part, once after. I don't get the purpose of World.setAllVisible(boolean)...if you don't want anything from a world to be visible, why render it in the first place?

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Performance Loss With Rendering 3D-2D-3D
« Reply #2 on: April 24, 2009, 08:10:41 am »
No, I know I have to render scene too. Could you guess how much slower it would perform with the software (OpenGL mode) renderer?

And to answer your question, so that I can set only the hero in the game to visible. But in a different scenario, you might be unsure of whether you have invisible objects (or otherwise be sure you have several) and will then get to set everything to visible.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Performance Loss With Rendering 3D-2D-3D
« Reply #3 on: April 24, 2009, 08:59:21 am »
I don't know exactly...something between 5 and 15% slower i would guess...

I see...i'll add that method to 1.18.

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Performance Loss With Rendering 3D-2D-3D
« Reply #4 on: April 24, 2009, 09:58:05 am »
Thanks a lot.