About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
FPS drop with multiple viewports on renderer
Author Message
SamNainocard Offline
Member

Post: #1
FPS drop with multiple viewports on renderer
I currently have a problem with rendering multiple viewports, two of them have their own renderer.

Currently I have 4 viewports each have their camera
1: Left Main Screen
2: Right Main Screen
3: Portrait
4: Character screen. (These 3 and 4)

The problem is, they make FPS loss when I have all of them rendering at the same time.
Also FPS will loss more if 2 also drawing GUI.
90 to 40 FPS from 1 viewport.

I also currently have a problem disabling others things in 3 and 4.
Portrait and Character screen shouldn't draw sky, sun (although tested with Sky.clear() and Sun.rays_mode=SUN_RAYS_OFF, but it's still contains a light source from sun.)

To sum up
1: Having lot of multiple viewports on rendering make a FPS loss, what caused this and how to fix it?
2: How can I make Renderer only render what I specified? (For performance.)

Thank you in advance.
12-27-2011 01:02 PM
Find all posts by this user Quote this message in a reply
Demostenes Offline
Banned

Post: #2
RE: FPS drop with multiple viewports on renderer
1) It is OK, new camera can even double overhead (you are rendering scene twice).
2) Sorry, on this engine I dont know, but it is usually solved by layers.
(This post was last modified: 01-02-2012 04:02 AM by Demostenes.)
01-02-2012 04:02 AM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #3
RE: FPS drop with multiple viewports on renderer
Sorry, but what's layers?
01-02-2012 11:42 AM
Find all posts by this user Quote this message in a reply
Demostenes Offline
Banned

Post: #4
RE: FPS drop with multiple viewports on renderer
(01-02-2012 11:42 AM)SamNainocard Wrote:  Sorry, but what's layers?

Something like layers in photoshop. In this case you can assign objects to some layers and specify on camera, which layer render. But as I told, there is nothing like this in EE.

You probably have to asign some flag to chosen objects and by code influent, what do you wish render in which view.
01-02-2012 02:13 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #5
RE: FPS drop with multiple viewports on renderer
Well, my renderer for portrait and chr screen are so short,

PHP Code:
Mesh         *ChrScreen::chrViewer::mesh;
CSkeleton     ChrScreen::chrViewer::cskel

void ChrScreen::chrViewer::draw()
{
    
cskel.clear().animate(L"../data/anim/stand.anim",0).updateMatrix(MatrixIdentity);
    
mesh->draw(cskel);
    
LightPoint(25Vec(0,0.5f,7.5f)).add();

PHP Code:
static void ChrViewerRender()
{
    switch(
Renderer())
    {
    case 
RM_PREPARE:
        {
            
ChrScreen::chrViewer::draw();
        }break;
    }

PHP Code:
void DrawGame()
{
                
using namespace ChrScreen::chrViewer;
        
cam.set();
        
viewport->setDisplayView();
        
Renderer(ChrViewerRender);

So, I'm not sure why it's take so much fps.
01-02-2012 04:41 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #6
RE: FPS drop with multiple viewports on renderer
Can't tell you why you are seeing an fps drop (it is probably normal), but I can point out that you are updating your cskel in the draw method. Please refer to the animation tutorials. In general all updating should be done in an update method and all drawing in a draw method. This applies to everything and becomes important in large projects.
01-02-2012 11:38 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #7
RE: FPS drop with multiple viewports on renderer
I just moved animating cskel to creating Player to just run for once (it's always stand at 0 anyway)

But FPS doesn't seems to improve.

Edit: I guess I'll just use portrait as Image because I'll make it static anyways, maybe external or internal using Renderer.capture() will try later.

But for Chr viewer still looking for why it take a lot of fps just to draw character mesh.
(This post was last modified: 01-03-2012 06:41 AM by SamNainocard.)
01-03-2012 05:55 AM
Find all posts by this user Quote this message in a reply
Post Reply