Josh Posted February 24, 2015 Share Posted February 24, 2015 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. Quote 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 More sharing options...
Josh Posted February 24, 2015 Share Posted February 24, 2015 ...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); Quote 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 More sharing options...
Josh Posted February 24, 2015 Share Posted February 24, 2015 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; } Quote 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 More sharing options...
Josh Posted February 24, 2015 Share Posted February 24, 2015 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/ Quote 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 More sharing options...
AnthonyPython Posted February 25, 2015 Share Posted February 25, 2015 that's certainly odd. Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
shadmar Posted February 25, 2015 Share Posted February 25, 2015 That is wierd. Maybe it's driver version related. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
YouGroove Posted February 25, 2015 Share Posted February 25, 2015 It is not possible to simply drop FBO once for all ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2015 Share Posted February 25, 2015 FBO is how render-to-texture is performed. It's part of the basic functionality of OpenGL. 1 Quote 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 More sharing options...
gamecreator Posted February 25, 2015 Share Posted February 25, 2015 https://www.opengl.org/wiki/Framebuffer_Object Quote Link to comment Share on other sites More sharing options...
shadmar Posted February 25, 2015 Share Posted February 25, 2015 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) 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted February 25, 2015 Share Posted February 25, 2015 And installed 347.52.. (why did I do that...) off.exe = 2270 fps as before on.exe = 540 fps ... wow that is insane... Rolling back to 344.75.. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted March 19, 2015 Share Posted March 19, 2015 Still broken in 347.88 (released march 17th..) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted April 25, 2015 Share Posted April 25, 2015 350.12 same issue. Can't this be worked around by putting some data in the buffers on your end? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
reepblue Posted April 25, 2015 Share Posted April 25, 2015 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. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Recommended Posts
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.