Jump to content

klepto2

Developers
  • Posts

    927
  • Joined

  • Last visited

Everything posted by klepto2

  1. It depends what verengerter is and what it data it holds. I assume color texture would be the later framebuffer / output? I don‘t know how the internal pix system works, but I to work flawlessly I needs to be similar to the way Leadwerks does it. Eg we need to load a shader (fragment or compute) and add not only textures but also variables ( push constants or uniform buffers). I must admit that I haven‘t fully thought about that yet. I know speed goes over flexibility but to get people into shader or effect programming it should be easy but flexible as possible.
  2. For sure This was done with leadwerks for a while:
  3. I get around 150 fps but this is because the rendering of the diffuse irradiance is very heavy and needs to be optimized or another faster way needs to be found. Through the nature of the precomputation, the sky and reflections are rendered in ~1ms (maybe faster). yes, while this is possible, i will currently focus on 1 planet. multiple planets at once will be supported later. Now i am starting withthe cloudsystem
  4. Here is a new Video, showing some improvements to the sky: - using more exposure - added a ground sphere to simulate the earth - fixed the cubemap distortion (not completely,, but much better)
  5. I could fix it for me when i generate the diffuse and reflection map with inversed z-component. Maybe this gives you the right hint.
  6. Here you may see it more clearly: and without the floor:
  7. I don't know if this is a bug for sure, but it seems the pbr reflection is not correctly aligned: Green: actual sun/light position Red: specular reflection is correct Yellow: actual reflection is off. Note: all cubemaps use the same layout and are rendered the same way.
  8. yes, i found the FileSystemWatcher in your VXRT sample, and already using it. with glslc or better libshaderc you don't need an external process, you can use a cpp api to handle the compilation and get errors etc. some people have done runtime descriptorSetgenerators with this ^^.
  9. Yes, of course it will rely on some UltraEngine internals like the CommandBuffer or some transfer data, like the VKTexture you implemnted for me. But everything else should be handled by the external lib by itself. I even use my own Vkbuffer instances, because it would be hard to acces your internals in the way it would be optimal for the library, also you would need to write things like VKTexture for everything which possibly might interact with vulkan. As said earlier, a more dynamic access to the posteffect system (add custom textures, as you have already subpasses you coud add some dummy pass which does nothing but pass external generated textures to the effect) would be awesome. For the computeshader (will work for all shaders) I am currently integrating glslc together with some Filewatching and logging system, which will recompile the shader code on the fly either at the start of the program or on a file change. this way you just need to edit the original shader and the spv is generated at runtime when needed (when the source has changed).
  10. I use some vulkan helper classes to make it easier to instantiate some of the VK_STRUCTURE_TYPES and handle/check for errors, but everything else for the compute shader is pure vulkan code by myself (of course collected from tutorials). Only a small part in my ComputeLibrary comes directly from Ultraengine (VulkanInstance, Device, ShaderModule, and math)
  11. mipmap generation works great now thx Josh. this is the main code i use currently to setup the environment pipeline: auto light = CreateLight(world, LIGHT_DIRECTIONAL); light->SetRotation(35, 45, 0); light->SetColor(1, 1, 1); auto environment = initalize_atmosphere(world); auto envSky = CreateTexture(TEXTURE_CUBE, 1024, 1024, TEXTURE_RGBA32, {} , 6, TEXTURE_STORAGE, TEXTUREFILTER_LINEAR, 0); auto envSkyWithoutSun = CreateTexture(TEXTURE_CUBE, 1024, 1024, TEXTURE_RGBA32, {} , 6, TEXTURE_STORAGE, TEXTUREFILTER_LINEAR, 0); auto reflectionTexture = CreateTexture(TEXTURE_CUBE, 256, 256, TEXTURE_RGBA32, {} , 6, TEXTURE_STORAGE | TEXTURE_MIPMAPS , TEXTUREFILTER_LINEAR, 0); auto diffTexture = CreateTexture(TEXTURE_CUBE, 64, 64, TEXTURE_RGBA32, {} , 6, TEXTURE_STORAGE, TEXTUREFILTER_LINEAR, 0); EnvironmentSkyContants skypush; skypush.cameraposition = Vec4(camera->GetPosition(), 0.0); skypush.lightdir = Vec4(Vec3(-light->matrix.k.x, -light->matrix.k.y, -light->matrix.k.z).Normalize(), 0.0); auto cshader = ComputeShader::Create("Shaders\\Environment\\simple_test.comp.spv"); cshader->SetupPushConstant(sizeof(EnvironmentSkyContants)); cshader->AddTargetImage(envSky); cshader->AddTargetImage(envSkyWithoutSun); cshader->AddUniformBuffer(&environment->_atmosphereData, sizeof(AtmosphereData), false); cshader->AddSampler(environment->m_transmittance_texture); cshader->AddSampler(environment->m_irradiance_texture); cshader->AddSampler(environment->m_scattering_texture); cshader->AddSampler(environment->m_optional_single_mie_scattering_texture); cshader->AddSampler(LoadTexture("Materials/Environment/noise.png")); cshader->BeginDispatch(world, envSky->GetSize().x / 16, envSky->GetSize().y / 16, 6, false, &skypush, sizeof(EnvironmentSkyContants)); auto irrshader = ComputeShader::Create("Shaders\\Environment\\env_irradiance_gen.comp.spv"); irrshader->AddSampler(reflectionTexture); irrshader->AddTargetImage(diffTexture); irrshader->BeginDispatch(world, diffTexture->GetSize().x / 16, diffTexture->GetSize().y / 16, 6, false); vector<EnvironmentSkyReflectionContants> reflShaders; for (int layer = 0; layer < reflectionTexture->CountMipmaps(); layer++) { auto refshader = ComputeShader::Create("Shaders\\Environment\\env_reflection_gen.comp.spv"); refshader->AddSampler(envSkyWithoutSun); refshader->AddTargetImage(reflectionTexture,layer); refshader->SetupPushConstant(sizeof(EnvironmentSkyReflectionContants)); EnvironmentSkyReflectionContants data; data.reflectiondata.x = layer / reflectionTexture->CountMipmaps(); refshader->BeginDispatch(world, reflectionTexture->GetSize().x / 16, reflectionTexture->GetSize().y / 16, 6, false, &data,sizeof(EnvironmentSkyReflectionContants)); reflShaders.push_back(data); } world->SetEnvironmentMap(envSky, ENVIRONMENTMAP_BACKGROUND); world->SetEnvironmentMap(reflectionTexture, ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(diffTexture, ENVIRONMENTMAP_DIFFUSE); The initalize_atmosphere is the method where the most magic happens, all required lookup textures are pre-generated for later use and are only calculated once. the other Computeshaders run recurring (which can be optimized to only run when parameters have changed)
  12. Ever wondered how cool Ultranengine might look in the northern nights?
  13. Here you can see the PBR playing nicely together with the Atmosphere:
  14. 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.
  15. 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.
  16. 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.
  17. Maybe a video says more than words: Now with correct camera and light positions.
  18. 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
  19. 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.
  20. I now have used WinDbg to get more details about the annoying GUARD_PAGE error and this is more detailed: (36c8.4f68): Guard page violation - code 80000001 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** WARNING: Unable to verify checksum for GUARD_ERROR_d.exe VCRUNTIME140D!memcpy+0x27f: 00007ffa`d786156f c4a17e7f8c0900ffffff vmovdqu ymmword ptr [rcx+r9-100h],ymm1 ds:0000014c`f5828000=00 And the StackTrace: VCRUNTIME140D!memcpy(void)+0x27f [D:\a\_work\1\s\src\vctools\crt\vcruntime\src\string\amd64\memcpy.asm @ 385] GUARD_ERROR_d!UltraRender::RenderContext::TransferData+0xcbd GUARD_ERROR_d!UltraRender::RenderContext::Render+0x557 GUARD_ERROR_d!UltraRender::RenderContext::Render+0x1f7 GUARD_ERROR_d!UltraRender::RenderingThreadManager::Update+0x1d62 GUARD_ERROR_d!UltraCore::ThreadManager::EntryPoint+0xae GUARD_ERROR_d!UltraEngine::Thread::thread_function+0xaa ucrtbased!thread_start<unsigned int (void * parameter = 0x0000014c`db315fe0)+0xb0 [minkernel\crts\ucrt\src\appcrt\startup\thread.cpp @ 97] KERNEL32!BaseThreadInitThunk+0x14 ntdll!RtlUserThreadStart+0x21 If you need more info we can arrange a remote debug session for tomorrow, today i am to busy.
  21. @Josh let me first try some things, it might be due a failed installation. I had to restore a backup, which might not be complete. If not we can try the remote dbg route.
  22. With every program using ultraengine. Even a clean new one.
  23. Confirmed unfortunatly the annoying "vcruntime140.dll not implemented" error is still there I tracked it down to the world->Render method. If i run the app without calling the render method the error is not visible. As a hint from stackoverflow the error code has some thing to do with PAGE_GUARDS: https://stackoverflow.com/a/2092136
  24. Hi, i was now able to test the last update after i was on vacation the last 2 weeks, but now i get some errors: First: As soon as I create a 3D Texture i get an assert here: > KernelBase.dll!00007fff6eaad662() Unbekannt Environment_d.exe!UltraEngine::RuntimeError(const UltraEngine::WString & s) Zeile 1715 C++ Environment_d.exe!UltraEngine::Assert(const bool condition) Zeile 1739 C++ Environment_d.exe!UltraRender::RenderTexture::SetPixels(std::shared_ptr<UltraEngine::Buffer> pixels, const int miplevel, const int face) Zeile 631 C++ [Externer Code] Environment_d.exe!UltraCore::ThreadManager::Update(const bool wait) Zeile 199 C++ Environment_d.exe!UltraRender::RenderingThreadManager::Update(const bool wait) Zeile 243 C++ Environment_d.exe!UltraCore::ThreadManager::EntryPoint(std::shared_ptr<UltraEngine::Object> o) Zeile 218 C++ Environment_d.exe!UltraEngine::Thread::thread_function(void * ptr) Zeile 31 C++ [Externer Code] This only seems to occur using 3D Textures when they are created like this: auto texture = CreateTexture(TEXTURE_3D, 256, 256, UltraEngine::TEXTURE_RGBA32, {}, 32, TextureFlags::TEXTURE_CLAMP_UVW | TextureFlags::TEXTURE_STORAGE, TextureFilter::TEXTUREFILTER_LINEAR, 0); Otherwise i always get this when running anything with the latest update (it runs, but extremely slow due to massive output): Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F4E00). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F5000). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F5600). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F5E00). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6000). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA17F3C20). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA17F3E20). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6600). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6800). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6A00). Ausnahme ausgelöst bei 0x00007FFF61A714D3 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6C00). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA17E7E80). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA17E7F00). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA17E7F80). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6DE4). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6E64). Ausnahme ausgelöst bei 0x00007FFF61A715BC (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6EE4). Ausnahme ausgelöst bei 0x00007FFF61A71421 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6F64). Ausnahme ausgelöst bei 0x00007FFF61A71421 (vcruntime140d.dll) in Environment_d.exe: 0x80000001: Nicht implementiert (Parameter: 0x0000000000000001, 0x000002ABA24F6F84). Visual Studio and everything is updated to the latest version.
×
×
  • Create New...