Josh Posted September 19, 2022 Author Share Posted September 19, 2022 @SpiderPig I fixed the problem you pointed out. There is still an issue that if you keep typing so the text pushes the original text out of the visible range of the frame, the line of text disappears. It seems to be a culling issue but I can't see why it would be happening, yet. 1 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 September 19, 2022 Share Posted September 19, 2022 Awesome! Noticed this in my project and managed to reproduce it in this program. I've only noticed this on a sphere so far (a red sphere to be precise), sometimes these white pixels pop up for a single frame. (It took a bit but I managed to take a picture of one! ) More noticeable if the camera moves but this sphere spins. It might be at the UV seam perhaps? Thought I'd mention it at least. Project is up to date. #include "UltraEngine.h" #include "ComponentSystem.h" int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFOV(70); camera->SetPosition(0, 0, -3); auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uicam->SetClearMode(CLEAR_DEPTH); uicam->SetRenderLayers(RENDERLAYER_1); uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2); auto ui = CreateInterface(world, LoadFont("Fonts/arial.ttf"), framebuffer->size); ui->SetRenderLayers(RENDERLAYER_1); ui->background->SetColor(0, 0, 0, 0); world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\diffuse.dds"), ENVIRONMENTMAP_DIFFUSE); world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\specular.dds"), ENVIRONMENTMAP_SPECULAR); //Create a light auto light = CreateLight(world, LIGHT_DIRECTIONAL); light->SetRotation(35, 45, 0); //Create a box auto box = CreateSphere(world); box->SetColor(1.0f, 0.0f, 0.0f); auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f); floor->SetPosition(0.0f, -1.0f, 0.0f); //Entity component system auto actor = CreateActor(box); auto component = actor->AddComponent<Mover>(); component->rotation.y = 45; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Link to comment Share on other sites More sharing options...
Josh Posted September 19, 2022 Author Share Posted September 19, 2022 If it a specular reflection or is it a crack showing the ground behind the sphere? 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 September 19, 2022 Share Posted September 19, 2022 Looks like its a crack showing what's on the other side. Made the floor orange and the camera's clear colour yellow - top half of sphere had yellow pixels and the bottom half had orange pixels popping. Link to comment Share on other sites More sharing options...
Josh Posted September 19, 2022 Author Share Posted September 19, 2022 Okay, I am using compressed vertex positions. That might be the cause. 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 September 19, 2022 Author Share Posted September 19, 2022 Here's an example that shows the problem right away. I'll switch to 32-bit floats and see if it goes away: #include "UltraEngine.h" int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0,1,1); camera->SetFOV(70); camera->SetPosition(0, 0, -2); auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uicam->SetClearMode(CLEAR_DEPTH); uicam->SetRenderLayers(RENDERLAYER_1); uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2); auto ui = CreateInterface(world, LoadFont("Fonts/arial.ttf"), framebuffer->size); ui->SetRenderLayers(RENDERLAYER_1); ui->background->SetColor(0, 0, 0, 0); world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\diffuse.dds"), ENVIRONMENTMAP_DIFFUSE); world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\specular.dds"), ENVIRONMENTMAP_SPECULAR); //Create a light auto light = CreateLight(world, LIGHT_DIRECTIONAL); light->SetRotation(35, 45, 0); //Create a box auto box = CreateSphere(world); box->SetColor(1.0f, 0.0f, 0.0f); auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f); floor->SetPosition(0.0f, -1.0f, 0.0f); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { camera->UpdateControls(window); world->Update(); world->Render(framebuffer); } return 0; } 1 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 September 19, 2022 Share Posted September 19, 2022 I made a console for my game and after using it a few times it crashes. I've reproduced the error here. If you press 'P' to set the text and then press 'TAB' to show the widget, it will crash. But no crash if you press 'TAB' first and then 'P'... #include "UltraEngine.h" int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 1, 1); camera->SetFOV(70); camera->SetPosition(0, 0, -2); auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uicam->SetClearMode(CLEAR_DEPTH); uicam->SetRenderLayers(RENDERLAYER_1); uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2); auto ui = CreateInterface(world, LoadFont("Fonts/arial.ttf"), framebuffer->size); ui->SetRenderLayers(RENDERLAYER_1); ui->background->SetColor(0, 0, 0, 0); //Create a light auto light = CreateLight(world, LIGHT_DIRECTIONAL); light->SetRotation(35, 45, 0); //Create a box auto box = CreateBox(world); auto textbox = CreateTextArea(10, 10, 100, 25, ui->root); textbox->SetHidden(true); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { ui->ProcessEvent(WaitEvent()); } if (window->KeyHit(KEY_P)) { textbox->SetText("Testing"); } if (window->KeyHit(KEY_TAB)) { textbox->SetHidden(!textbox->GetHidden()); } world->Update(); world->Render(framebuffer); } return 0; } Link to comment Share on other sites More sharing options...
klepto2 Posted September 19, 2022 Share Posted September 19, 2022 Ok, my error is gone. I think it might be due to some issues with the vlkan sdk configurator. There i had accidently enabled some validation layers and after resetting it to the defualt everything seems to work correctly. 1 1 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
klepto2 Posted September 19, 2022 Share Posted September 19, 2022 Now that the error is gone this actually works: Note: The cubemap has currently just a fixed camera and light position, but it is rendered in realtime to the PBR materials 2 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted September 19, 2022 Author Share Posted September 19, 2022 I think this is the shader Khronos uses to generate diffuse cubemaps from an HDRI: https://github.com/KhronosGroup/glTF-IBL-Sampler/blob/master/lib/source/shaders/filter.frag I'm not sure how fast it will be. When I was converting high-res HDRIs with the utility it was very slow. 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 September 19, 2022 Author Share Posted September 19, 2022 Another update. All the recent bug posts I replied to are fixed. VXRT is temporarily disabled. If you uninstall the application you can select another branch that has the previous build with VXRT. 1 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 September 19, 2022 Author Share Posted September 19, 2022 I'm thinking about adding a feature to mark a volume as "indoors", meaning any pixels in that volume won't be affected by the skybox in the PBR reflection. If you had a house on stilts and added a 7-sided brush, it would create a volume inside the building that went all the way up into the rafters. The inside of the house would be dark, the outside would be bright, directional lights would still come through the door and windows, and there would be a soft shadowed area underneath the house. It could include a padding parameter to control how sharp the transition is. 1 1 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 September 20, 2022 Share Posted September 20, 2022 19 hours ago, klepto2 said: Now that the error is gone this actually works: Note: The cubemap has currently just a fixed camera and light position, but it is rendered in realtime to the PBR materials Looks very nice, good job! Are you working on a day / night cycle? Link to comment Share on other sites More sharing options...
klepto2 Posted September 20, 2022 Share Posted September 20, 2022 Maybe a video says more than words: Now with correct camera and light positions. 1 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted September 20, 2022 Author Share Posted September 20, 2022 What happens when you get even further away from the camera into space? 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...
klepto2 Posted September 20, 2022 Share Posted September 20, 2022 you mean like this: It is currently distorted because of the render to cubemap. Rendering it as a post effect would be better for those outer atmosphere sequences. Then it would be also possible to support multiple planets etc. Here is another shot with a small 64*64 irradiance map: for the diffuse layer. the generation slows the whole process down a lot, rendering to higher resolution will bring it down to less than 20 fps which is far too slow. But i have ideas how to make this with just the pre computed textures instead of sampling the generated cubemap. 2 1 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted September 20, 2022 Author Share Posted September 20, 2022 If you got really far away, would the planet become a small sphere in the distance? How did you make the irradiance maps? Very cool stuff. 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...
klepto2 Posted September 20, 2022 Share Posted September 20, 2022 The IBL is generated this way, and it is generated now with a size of 64*64 and a sample size of 0.125 which is a good compromise for realtime use. In theory the atmosphere can be used for full atmospheres viewed from space and from ground (with fluent transition) . So yes, the planet will become smaller and smaller. @Josh: I found a small bug with the GetVKTexture() Method. I am trying to render into the mipmaps (which works fine) but when using textures with mipmaps the imageview array just contains 9 levels instead of 10. not including the main level and at the first index of this array is just the first miplevel not the actual highest res one. Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted September 20, 2022 Author Share Posted September 20, 2022 so imageview[0] contains mipmap 1? 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 September 20, 2022 Author Share Posted September 20, 2022 I see. I will fix it for you 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 September 20, 2022 Author Share Posted September 20, 2022 Mipmap 0 is the image view for the image. That is the full-resolution image. I'm pretty sure I fixed it. It was just like that because originally I did not realize each mipmap had its own imageview. 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...
klepto2 Posted September 20, 2022 Share Posted September 20, 2022 If you create a texture with a size of 512 you have 10 image views, but the array just contains 9. 512*512 -> not in array 256*256 - 1*1 are in the array. here is some hints from the debug: on the left you see all provided imageviews in the VKTexture. On the right you see the missing main imageView of the texture (marked yellow). and here is the result in NSight: at the bottom you can see that the actual mipmapsize is 10 not 9. and the toplevel mipmap is not rendered. Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted September 20, 2022 Author Share Posted September 20, 2022 Yes, you are correct. It contains mipmap 1-9, but 0 is missing. Next update will fix it. 1 1 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...
klepto2 Posted September 20, 2022 Share Posted September 20, 2022 Here you can see the PBR playing nicely together with the Atmosphere: 3 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
SpiderPig Posted September 21, 2022 Share Posted September 21, 2022 On 9/20/2022 at 1:47 AM, Josh said: I'm thinking about adding a feature to mark a volume as "indoors", meaning any pixels in that volume won't be affected by the skybox in the PBR reflection. If you had a house on stilts and added a 7-sided brush, it would create a volume inside the building that went all the way up into the rafters. The inside of the house would be dark, the outside would be bright, directional lights would still come through the door and windows, and there would be a soft shadowed area underneath the house. It could include a padding parameter to control how sharp the transition is. I think this is a good idea. I think the ray tracing is great and looks superb but I can't see my self using it in a large procedurally generated world. Just because it needs that extra processing power, and I'm greedy and want it to do other things I'm taking a look at the physics stuff now and want to setup my own player controller. The KinematicJoint example crashes a few moments in and in my game, passing a model to it makes it return nullptr. Is there still some work to do on physics? Link to comment Share on other sites More sharing options...
Recommended Posts