SpiderPig Posted March 9 Share Posted March 9 The example here throws an error with the latest build. https://www.ultraengine.com/learn/CreateTerrain?lang=cpp Quote Link to comment Share on other sites More sharing options...
Josh Posted March 10 Share Posted March 10 It just says "Assert failed"? I am adding a bunch more messages to the assert statements. Normally these are cases that should never be hit. 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...
SpiderPig Posted March 10 Author Share Posted March 10 Yeah that's the only error I got. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Okay, please try it now and see if it says any other information. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Downloaded the latest update and updated the project and still the same error. Do you get this error on your machine or is it specific to my machine you think? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 I don't get any error. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Could it be problem with Refraction.fx or might it be totally unrelated? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 What GPU do you have? 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...
SpiderPig Posted March 11 Author Share Posted March 11 GTX 980 Ti. I'm seeing if there's a driver update now. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Does VS show you what file the error is occurring in? It's not good for me to have a bunch of asserts with no clear error messages. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Kind of. This is the call stack. ...did you say that terrain textures need to be the same size as the terrain resolution? I see the extra parameter for the texture size. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Yes, that is what I needed. Please install GPU caps viewer: https://www.ozone3d.net/gpu_caps_viewer/ Check and see if your card support the GL_ARB_bindless_texture extension. 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...
SpiderPig Posted March 11 Author Share Posted March 11 It says it does. I have had other shaders of mine compiling and running that use that extension. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Okay, I am adding some more debugging messages... 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...
Josh Posted March 11 Share Posted March 11 Okay, I added some more error checking, so either the texture ID is invalid or it can't be turned into a bindless texture handle. Only you will be able to tell. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Um... well the errors gone but I think it's now stuck in a loop or something... currently at 3 minutes at time of posting. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted March 11 Author Share Posted March 11 A different error but it might help pinpoint this problem... just simply creating the terrain crashes to "encodeData" or something like that. #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); //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) { world->Update(); world->Render(framebuffer); } return 0; } Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Okay, that is indeed a separate bug but it's pretty small, and can be avoided by setting one height value anywhere in the terrain. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Maybe a remote debug then? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 That may be the next step. Let's pick it back up tomorrow or later this week. 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...
Josh Posted March 11 Share Posted March 11 This is interesting. There is some high-intensity code in the terrain materials building system. I was at one point going to move this to a compute shader because I thought it was too much for the CPU. However, once I had rewritten the algorithm to work with shaders, it was then running fast enough that I kept it on the CPU. (I actually had to write my own sorting code to make it work.) There are two assert statements in the algo that did not have any messages. Simple adding some text in the second argument to Assert was enough to slow down the code to a crawl, which is what you saw. This is not normally something you need to worry about, but the Assert statements were being called more than a million times. I will upload a new build after lunch. You are probably asleep right now. 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...
SpiderPig Posted March 11 Author Share Posted March 11 Will test very soon. I just woke up. 🥱 Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted March 11 Author Share Posted March 11 It still hangs in the same place. Project is up to date. This is the call stack when I pause it after a minute or so. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11 Share Posted March 11 Lunch has just finished. Now I am uploading... 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...
SpiderPig Posted March 11 Author Share Posted March 11 I waited 2 minutes but it still hangs at the same place. Call stack is the same as I posted above. Project is up to date and cleaned. Quote 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.