SpiderPig Posted March 13, 2024 Posted March 13, 2024 Maybe a bug - maybe. In this example I see no change in the FPS between debug and release builds. I get a consistent 500 FPS (+/- 10 FPS). I'm seeing this across a few of my smaller projects. I mean, is debug build just that good now or is release slower than it should be? I would've thought there should be at least a small difference being the debugger isn't running in Release - but I've been wrong before. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the display list auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); world->SetAmbientLight(0); world->RecordStats(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetFov(70); camera->SetPosition(0, 50, 0); camera->SetRotation(45, 0, 0); camera->SetClearColor(0.125); //Sunlight auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(2); //Create terrain auto terrain = CreateTerrain(world, 512, 512, 2048); terrain->LoadHeightmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Terrain/512.r16"); terrain->SetScale(1, 100, 1); //Create base material auto ground = CreateMaterial(); auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_2k.dds"); auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_2k.dds"); ground->SetTexture(diffusemap, TEXTURE_BASE); ground->SetTexture(normalmap, TEXTURE_NORMAL); terrain->SetMaterial(ground); //Create paint material auto rocks = CreateMaterial(); diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k.dds"); normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_dot3.dds"); auto dispmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_disp.dds"); rocks->SetTexture(diffusemap, TEXTURE_BASE); rocks->SetTexture(normalmap, TEXTURE_NORMAL); rocks->SetTexture(dispmap, TEXTURE_DISPLACEMENT); int rocklayer = terrain->AddLayer(rocks); //Apply material based on terrain slope for (int x = 0; x < terrain->resolution.x; ++x) { for (int y = 0; y < terrain->resolution.y; ++y) { float slope = terrain->GetSlope(x, y); if (slope > 15.0f) { float wt = Min((slope - 15.0f) / 10.0f, 1.0f); terrain->SetLayerWeight(rocklayer, x, y, wt); } } } //Camera controls //camera->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { auto stats = world->renderstats; window->SetText("FPS : " + WString(stats.framerate)); world->Update(); world->Render(framebuffer, false); } return 0; } Quote
Solution klepto2 Posted March 13, 2024 Solution Posted March 13, 2024 Just my thought. The debug-build was mainly slower because the vulkan validation-layer kicks in and slows everything down. In Leadwerks there was also no difference between debug and release (for simple apps). 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI
Dreikblack Posted March 13, 2024 Posted March 13, 2024 3200-3500 in debug for me, 3800 fps in release mode Quote
Josh Posted March 13, 2024 Posted March 13, 2024 Vulkan validation layers were quite slow, and there's also more code being executed in the driver in OpenGL. So the results you are posting right now are not surprising. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
SpiderPig Posted March 13, 2024 Author Posted March 13, 2024 5 hours ago, klepto2 said: Just my thought. The debug-build was mainly slower because the vulkan validation-layer kicks in and slows everything down. In Leadwerks there was also no difference between debug and release (for simple apps). That makes sense. Quote
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.