-
Posts
929 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by klepto2
-
that should work
-
eg: a cheap fog using real atmospheric lookups. Currently, this would need (and is probably the better way) a modification of the PBR shaders and additional textures and parameters to the material system. There are tons of pfx which may not only rely on down scaled 2d textures but also on custom 3d textures etc.. I haven't tried the pfx system yet that much, so i can't really say how flexible this will be. To be honest i think we can't compare Leadwerks and Ultraengine on this topic. While it was easy to render a sky as a posteffect (or water like shadmar did) as it would break the PBR rendering. But one sample comes into my mind: underwater fx. if the water/ocean has a flexible height we need to pass the ocean heightfield and the parameters to the underwater posteffect to mask out the areas where the camera is partially above the water.
-
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.
-
For sure This was done with leadwerks for a while:
-
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
-
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)
-
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.
-
-
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.
-
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 ^^.
-
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).
-
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)
-
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)
-
-
-
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.
-
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.
-
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.
-
Maybe a video says more than words: Now with correct camera and light positions.
-
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
-
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.
-
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.
-
@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.
-
With every program using ultraengine. Even a clean new one.