Jump to content

Performance Issues.


lxFirebal69xl
 Share

Recommended Posts

I found the cause and it is very strange. You can simulate this in any C++ program simply by adding this code at the end of the App::Start() function:

    for (int n = 0; n < 36*6; n++)
   {
       Buffer::Create(64, 64, 0, 1);
   }

 

It seems that having an FBO just exist and not do anything degrades performance on Nvidia cards.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

...I was right. Even calling the simplest possible pure FBO commands does it:

    for (int n = 0; n < 36*6; n++)
   {
       uint32 framebuffer;
       glGenFramebuffers(1, &framebuffer);
       glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
   }
   glBindFramebuffer(GL_FRAMEBUFFER, 0);

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

And another example. when TESTFBO=0 FPS is 100, drops in half if you set TESTFBO=1:

#include "App.h"

using namespace Leadwerks;

App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}

App::~App() { delete world; delete window; }

bool App::Start()
{
window = Window::Create();
context = Context::Create(window);
world = World::Create();
camera = Camera::Create();
camera->Move(0, 0, -8);

#define TESTFBO 1

#if TESTFBO==1
for (int n = 0; n < 36 * 6; n++)
{
	uint32 framebuffer;
	glGenFramebuffers(1, &framebuffer);
	glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif	

return true;
}

bool App::Loop()
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

Time::Update();
world->Update();
world->Render();

context->SetBlendMode(Blend::Alpha);
context->SetColor(1, 1, 1, 1);
context->DrawText(String(Time::UPS()),0,0);

context->Sync(false);

return true;
}

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I'm reporting this to Nvidia. In the meantime I recommend using the Static + Dynamic setting for your lights.

https://devtalk.nvidia.com/default/topic/813945/general-graphics-programming/bug-report-non-active-fbo-causes-much-slower-rendering/

 

I get 1000fps in either using your uploaded test to nvidia.

Win 8.1 - GTX 770M 344.75 drivers. (laptop)

 

Edit:

However fraps says 2270 fps (off.exe) and 2060 fps (on.exe)

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

On my end, If I have a directional light with even Static shadows, my framerate gets cuts in half. (On a good size map with 350.12.)

 

EDIT: It's seems it's something with my exe that handles menuUI and such. Installed the older exes and the game runs fine.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...