-
Posts
929 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by klepto2
-
You need to keep track of each variable you create, if you just do something like this: auto window = CreateWindow("Window 1"....); window = CreateWindow("Window 2"....); then the first window is not referenced anymore and therefore deleted. To better handle this, you should use classes to hold everything your windows need. (one class per window). A very basic sample: #include "UltraEngine.h" using namespace UltraEngine; class MyWindowBase : public Object { protected: shared_ptr<Window> _window; shared_ptr<Interface> _ui; string _title; bool _closed; public: MyWindowBase(string title,int px,int py, int width,int height, vector<shared_ptr<Display>> displays) : _title(title) { _window = CreateWindow(_title,px,py,width,height, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CENTER); _ui = CreateInterface(_window); _closed = false; } bool Closed() { return _closed; } void virtual Init() abstract; bool virtual Update(const Event ev) { if (ev.source != NULL && ev.source->As<Window>() == _window && !_closed) { switch (ev.id) { case EVENT_WINDOWCLOSE: _closed = true; _window = NULL; return true; } } return false; } }; class MainWindow : public MyWindowBase { private: shared_ptr<Widget> _listbox; public: MainWindow(string title, int px, int py, int width, int height, vector<shared_ptr<Display>> displays) : MyWindowBase(title, px, py, width, height, displays) { Init(); } void Init() override { auto sz = _ui->root->GetSize(); _listbox = CreateListBox(20, 20, sz.x - 40, sz.y - 40, _ui->root); _listbox->AddItem("Item 1", true); _listbox->AddItem("Item 2"); _listbox->AddItem("Item 3"); _listbox->AddItem("Item 4"); _listbox->AddItem("Item 5"); _listbox->AddItem("Item 6"); _listbox->SetLayout(1, 1, 1, 1); } bool virtual Update(const Event ev) override { if (!MyWindowBase::Update(ev)) { switch (ev.id) { case EVENT_WIDGETACTION: Print("Item " + String(ev.data) + " action"); break; case EVENT_WIDGETSELECT: Print("Item " + String(ev.data) + " selected"); break; } } return false; } }; class SecondWindow : public MyWindowBase { private: shared_ptr<Widget> _listbox; public: SecondWindow(string title, int px, int py, int width, int height, vector<shared_ptr<Display>> displays) : MyWindowBase(title, px, py, width, height, displays) { Init(); } void Init() override { auto sz = _ui->root->GetSize(); _listbox = CreateListBox(20, 20, sz.x - 40, sz.y - 40, _ui->root); _listbox->AddItem("Item 1.1", true); _listbox->AddItem("Item 1.2"); _listbox->AddItem("Item 1.3"); _listbox->AddItem("Item 1.4"); _listbox->AddItem("Item 1.5"); _listbox->AddItem("Item 1.6"); _listbox->SetLayout(1, 1, 1, 1); } bool virtual Update(const Event ev) override { if (!MyWindowBase::Update(ev)) { switch (ev.id) { case EVENT_WIDGETACTION: Print("Item " + String(ev.data) + " action"); break; case EVENT_WIDGETSELECT: Print("Item " + String(ev.data) + " selected"); break; } } return false; } }; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); vector<shared_ptr<MyWindowBase>> windows; windows.push_back(make_shared<MainWindow>("Main Window", 0, 0, 800, 600, displays)); windows.push_back(make_shared<SecondWindow>("Second Window", 400, 300, 400, 300, displays)); bool running = true; while (running) { const Event ev = WaitEvent(); running = false; for (auto w : windows) { if (w->Update(ev)) break; if (!w->Closed()) running = true; } } return 0; }
-
To be honest, I just corrected the shadow map lookups in the Lighting.glsl and replaced the Lighting lookup with the one from PBRLighting. Otherwise i just added some MieScattering and i actually reworked the raymarching you used to a fixed step to always get the full raymarching. Everything else should be more or less the same as your experiment.
-
Reworked Volumetric Lighting: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto plg = LoadPlugin("Plugins/KTX2TextureLoader"); auto plg2 = LoadPlugin("Plugins/FITextureLoader"); //Get the displays 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(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetRotation(45, 0, 0); camera->SetFOV(70); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/SSR.json")); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/FXAA.json")); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/SSAO.json")); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/Bloom.json")); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/VolumetricLighting.json")); world->SetEnvironmentMap(LoadTexture("Materials/Environment/Storm/Diffuse.dds"), ENVIRONMENTMAP_DIFFUSE); world->SetEnvironmentMap(LoadTexture("Materials/Environment/Storm/Specular.dds"), ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(LoadTexture("Materials/Environment/Storm/Specular.dds"), ENVIRONMENTMAP_BACKGROUND); world->SetAmbientLight(0.0); auto sponza = LoadModel(world, "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Sponza/glTF/Sponza.gltf"); camera->Move(sponza->GetBounds(BOUNDS_RECURSIVE).center); auto pointlight = CreatePointLight(world); pointlight->SetPosition(sponza->GetBounds(BOUNDS_RECURSIVE).center); pointlight->SetColor(0.0,2.0,0.0,10.0); pointlight->SetRange(0.1, 25.0); pointlight->SetShadowMapSize(1024); auto spotlight = CreateSpotLight(world); spotlight->SetPosition(sponza->GetBounds(BOUNDS_RECURSIVE).center + Vec3(0.0,2.0,0.0)); spotlight->SetColor(2.0, 0.0, 0.0, 100.0); spotlight->SetRange(0.1, 25.0); spotlight->SetShadowMapSize(1024); auto light = CreateDirectionalLight(world); light->SetRotation(45, -45, 0); light->SetColor(1.0,1.0,1.0,5.0); light->SetShadowMapSize(2048); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { auto center = sponza->GetBounds(BOUNDS_RECURSIVE).center + Vec3(0.0, sin(world->GetTime() * 0.0005) * (sponza->GetBounds(BOUNDS_RECURSIVE).size.height * 0.25), 0.0); pointlight->SetPosition(center); spotlight->Turn(0.0, 1.0, 0.0); camera->UpdateControls(window); world->Update(); world->Render(framebuffer); } return 0; } The Volumetric Strength can be controlled with the alpha value of the lightcolor. You can experiment as well by changeing the #define G_SCATTERING 0.25 in VolumetricLighting.frag. Higher Values will make the Volumetric effect more localized, lower values will make it more uniform. Maybe when the SetVolumetricStrength is passed to the LightInfo, this can be used for the strength and G_SCATTERING can be provided with the alpha value. Volumetric_Lighting.zip
-
Works now perfectly. One sidenote: I know a backup of the changed files is made, but i believe the template files especially the main.cpp or other possibly heavily modified files by users should not be changed by an update. Shaders etc. provided by the engine should be updated, but nothing else.
-
My bad, the basic sample works. but using SetEnvironmentMap throws errors now: > VolumetricLighting_d.exe!std::_Ptr_base<class UltraRender::RenderMaterial>::get(void) Unbekannt VolumetricLighting_d.exe!std::shared_ptr<class UltraRender::RenderMaterial>::operator-><class UltraRender::RenderMaterial,0>(void) Unbekannt VolumetricLighting_d.exe!UltraRender::RenderWorld::SetEnvironmentMap(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap) Unbekannt VolumetricLighting_d.exe!std::invoke<void ( UltraRender::RenderWorld::*&)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap &>(void ( UltraRender::RenderWorld::*&)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap &) Unbekannt VolumetricLighting_d.exe!std::_Invoker_ret<struct std::_Unforced>::_Call<void ( UltraRender::RenderWorld::*&)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap &>(void ( UltraRender::RenderWorld::*&)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap &) Unbekannt VolumetricLighting_d.exe!std::_Call_binder<struct std::_Unforced,0,1,2,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::tuple<class std::shared_ptr<class UltraRender::RenderWorld>,class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap>,class std::tuple<> >(struct std::_Invoker_ret<struct std::_Unforced>,struct std::integer_sequence<unsigned __int64,0,1,2>,void ( UltraRender::RenderWorld::*&)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::tuple<class std::shared_ptr<class UltraRender::RenderWorld>,class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap> &,class std::tuple<> &&) Unbekannt VolumetricLighting_d.exe!std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &>::operator()<>(void) Unbekannt VolumetricLighting_d.exe!std::invoke<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &> &>(class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &> &) Unbekannt VolumetricLighting_d.exe!std::_Invoker_ret<void>::_Call<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &> &>(class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &> &) Unbekannt VolumetricLighting_d.exe!std::_Func_impl_no_alloc<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderWorld::*)(class std::shared_ptr<class UltraRender::RenderTexture>,enum UltraEngine::EnvironmentMap),class std::shared_ptr<class UltraRender::RenderWorld> &,class std::shared_ptr<class UltraRender::RenderTexture> &,enum UltraEngine::EnvironmentMap const &>,void>::_Do_call(void) Unbekannt VolumetricLighting_d.exe!std::_Func_class<void>::operator()(void) Unbekannt VolumetricLighting_d.exe!UltraCore::ThreadManager::Update(bool) Unbekannt VolumetricLighting_d.exe!UltraRender::RenderingThreadManager::Update(bool) Unbekannt VolumetricLighting_d.exe!UltraCore::ThreadManager::EntryPoint(class std::shared_ptr<class UltraEngine::Object>) Unbekannt VolumetricLighting_d.exe!UltraEngine::Thread::thread_function(void *) Unbekannt ucrtbased.dll!00007ff84fa73010() Unbekannt kernel32.dll!00007ff8f29a7034() Unbekannt ntdll.dll!00007ff8f48e26a1() Unbekannt
-
unfortunatly I still get the above error
-
I get an access violation with the new version with a blank new project and all other projects: > NewVersionTest_d.exe!std::_Ptr_base<class UltraRender::GPUBuffer>::get(void) Unbekannt NewVersionTest_d.exe!std::shared_ptr<class UltraRender::GPUBuffer>::operator-><class UltraRender::GPUBuffer,0>(void) Unbekannt NewVersionTest_d.exe!UltraRender::RenderMaterial::Submit(void) Unbekannt NewVersionTest_d.exe!UltraRender::RenderingThreadManager::GetDefaultMaterial(void) Unbekannt NewVersionTest_d.exe!UltraRender::RenderMesh::Initialize(void) Unbekannt NewVersionTest_d.exe!std::invoke<void ( UltraRender::RenderMesh::*&)(void),class std::shared_ptr<class UltraRender::RenderMesh> &>(void ( UltraRender::RenderMesh::*&)(void),class std::shared_ptr<class UltraRender::RenderMesh> &) Unbekannt NewVersionTest_d.exe!std::_Invoker_ret<struct std::_Unforced>::_Call<void ( UltraRender::RenderMesh::*&)(void),class std::shared_ptr<class UltraRender::RenderMesh> &>(void ( UltraRender::RenderMesh::*&)(void),class std::shared_ptr<class UltraRender::RenderMesh> &) Unbekannt NewVersionTest_d.exe!std::_Call_binder<struct std::_Unforced,0,void ( UltraRender::RenderMesh::*)(void),class std::tuple<class std::shared_ptr<class UltraRender::RenderMesh> >,class std::tuple<> >(struct std::_Invoker_ret<struct std::_Unforced>,struct std::integer_sequence<unsigned __int64,0>,void ( UltraRender::RenderMesh::*&)(void),class std::tuple<class std::shared_ptr<class UltraRender::RenderMesh> > &,class std::tuple<> &&) Unbekannt NewVersionTest_d.exe!std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &>::operator()<>(void) Unbekannt NewVersionTest_d.exe!std::invoke<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &> &>(class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &> &) Unbekannt NewVersionTest_d.exe!std::_Invoker_ret<void>::_Call<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &> &>(class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &> &) Unbekannt NewVersionTest_d.exe!std::_Func_impl_no_alloc<class std::_Binder<struct std::_Unforced,void ( UltraRender::RenderMesh::*)(void),class std::shared_ptr<class UltraRender::RenderMesh> &>,void>::_Do_call(void) Unbekannt NewVersionTest_d.exe!std::_Func_class<void>::operator()(void) Unbekannt NewVersionTest_d.exe!UltraCore::ThreadManager::Update(bool) Unbekannt NewVersionTest_d.exe!UltraRender::RenderingThreadManager::Update(bool) Unbekannt NewVersionTest_d.exe!UltraCore::ThreadManager::EntryPoint(class std::shared_ptr<class UltraEngine::Object>) Unbekannt NewVersionTest_d.exe!UltraEngine::Thread::thread_function(void *) Unbekannt ucrtbased.dll!00007ff820a73010() Unbekannt kernel32.dll!00007ff8f29a7034() Unbekannt ntdll.dll!00007ff8f48e26a1() Unbekannt Error: Failed to load shader module "Shaders/Downsample.frag.spv" Ausnahme ausgelöst bei 0x00007FF6F99739C6 in NewVersionTest_d.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x0000000000000258.
-
Small experiment with an adaption of Josh's Volumetric Lighting experiment: The scene has one static directional light and a moving point light.
-
Maybe i am thinking wrong, but if a ENVIRONMAP_DIFFUSE is used, this should be used as a lookup for the ambientlight. In earlier versions this was clearly visible, but now it seems, that only the ambientlight setting is affecting the scene: In this screenshot i have used the diffuse texture as a background to visualize it a bit better:
-
Oh my! Stupid mistake by myself. Of course the initial scale has to be taken into account as well. looking forward testing the new updates i am currently cleaning up my code and hope to publish a first release of the compute library next week. I just need to add structure buffers and make the texture assignment more dynamic. But the whole thing works really nice. I am thinking about a simple sample. Which takes just a cubemap and calculates the ibl and diffuse textures on the fly. So no need using extra tools.
-
I am currently trying to get a bit more used with the UI-3D interactions and wrote a small but simple gltf-viewer based on the khronos viewer, it extracts the sample models from the khronos github and you can switch between the models and view them. Due the fact, that the models are in deifferent scales from very tiny ( < 0.01 units) to very big ( > 1000.0 units) I try to scale them to a unified width, which works most of the time. But from time to time with different models i get unexpected results: Sponza: (way too big) ----------------------------------------- Original-AABB:29.7668, 12.447, 18.3059 ScaleFactor :0.167972 New-AABB :625, 261.344, 384.359 Engine: (correct) ----------------------------------------- Original-AABB:1379.28, 954.6, 1093.35 ScaleFactor :0.00362508 New-AABB :5, 3.4605, 3.96346 This is a very basic sample to show it: #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto plg = LoadPlugin("Plugins/KTX2TextureLoader"); auto plg2 = LoadPlugin("Plugins/FITextureLoader"); //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); //Create a light auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); float desiredWidth = 5.0; auto sponza = LoadModel(world, "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Sponza/glTF/Sponza.gltf"); auto originalAABB = sponza->GetBounds(BOUNDS_RECURSIVE); auto scaleFactor = desiredWidth / originalAABB.size.width; sponza->SetScale(scaleFactor); auto newAABB = sponza->GetBounds(BOUNDS_RECURSIVE); Print("Sponza:"); Print("-----------------------------------------"); Print("Original-AABB:" + WString(originalAABB.size)); Print("ScaleFactor :" + WString(scaleFactor)); Print("New-AABB :" + WString(newAABB.size)); auto engine = LoadModel(world, "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/2CylinderEngine/glTF/2CylinderEngine.gltf"); auto originalAABB1 = engine->GetBounds(BOUNDS_RECURSIVE); auto scaleFactor1 = desiredWidth / originalAABB1.size.width; engine->SetScale(scaleFactor1); auto newAABB1 = engine->GetBounds(BOUNDS_RECURSIVE); Print("Engine:"); Print("-----------------------------------------"); Print("Original-AABB:" + WString(originalAABB1.size)); Print("ScaleFactor :" + WString(scaleFactor1)); Print("New-AABB :" + WString(newAABB1.size)); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
-
-
The range is near: 50000.0 far:10000000.0 I dynamically increase the near range in steps the more i am away from the planet. I think it should be easier later if Doubles are used, but the shaders i have written are not yet build for that. Also I think a way to overcome this would be to use 2 cameras, one for the near objects, and a second for the planet stuff. The Radius of the earth is 6.371.000 m.
-
-
yeah, that might be true. Setting the Color of a directional light to 0.1,0.1,0.1 instead of full bright fixes the problem as well, but there are still some issues with the directional shadows: The shadows are not very smooth. And they blend out way too early for directional lights (in my opinion). Blocky:
-
The sample looks nice, but once you setup a directional light, the whole scene (except the background) becomes ultra bright: auto light = CreateDirectionalLight(world); light->SetRotation(45, -45, 0); Sidequestion: Is there a way to increase the Texturelimits? currently there are just 16 cubemaps allowed, Can this be altered in some way? In earler versions this was done through the ultra.json if i rembmer correctly.
-
True. This is not needed there. I have taken this from another shader i use and there i need to normalize the vector, but here it is indeed not needed.
-
Another small bug report (with potential fix): When you move the camera to a position which is further away from the center than the far range, the sykbox becomes distorted and doesn't work anymore: auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetRange(0.1, 1000); camera->SetPosition(0, 0, -1000); with a change to sky.frag to this: #version 450 #extension GL_GOOGLE_include_directive : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_shader_draw_parameters : enable #extension GL_EXT_multiview : enable #include "../Base/Limits.glsl" #include "../Base/PushConstants.glsl" #include "../Base/StorageBufferBindings.glsl" #include "../Base/TextureArrays.glsl" #include "../Base/materials.glsl" #include "../Base/UniformBlocks.glsl" #include "../Utilities/ReconstructPosition.glsl" //#include "../base/base_frag.glsl" //layout(binding = TEXTURE_BUFFER_CUBE) uniform samplerCube textureCubeSampler[MAX_TEXTURES_CUBE]; //Inputs layout(location = 0) in flat mat4 cameraMatrix; layout(location = 9) in flat uint materialID; layout(location = 4) in flat mat4 cameraProjMatrix; //Outputs layout(location = 0) out vec4 outColor; void main() { if (EnvironmentMap_Background != -1) { vec3 screencoord; screencoord.xy = gl_FragCoord.xy / BufferSize; screencoord.z = 0.0;// get the depth at this coord; vec3 fragposition = ScreenCoordToWorldPosition(screencoord); vec3 v = normalize(CameraPosition - fragposition); v*=vec3(-1.0); //vec4 screencoord = vec4((gl_FragCoord.xy / bufferSize.xy - 0.5f) * 2.0f, 1.0f, 1.0f); //vec4 screencoord = vec4(((gl_FragCoord.xy - cameraViewport.xy) / cameraViewport.zw - 0.5f) * 2.0f, 1.0f, 1.0f); //vec3 texcoord = normalize(CameraPosition - (cameraProjMatrix * screencoord).xyz); outColor = textureLod(textureCubeSampler[EnvironmentMap_Background], v, 0);//9.5f) * 1.0f; } else { outColor = vec4(1,0,1,1); } } The sykbox is correctly centered around the camera at any position:
-
If you want some basic syntax highlighting and error reporting for the shaders in visual studio I can recommend this: https://github.com/danielscherzer/GLSL Configuration to let it be compatible with Ultraengine and Vulkan: The Expand includes is currently needed as the Compileprocess generates a temporary file under %temp% and so there is no direct access to the include files in the shader, but the error detection still works. it can't compile yet to spv files because the Arguments-System is a bit limited, but maybe we can change this
-
Hi Josh, while you're working on new features and refining them, i would like to suggest some improvements to the client hub: Update-Tab: It would be nice to have a Button to directly browse the installation directory (like in the Projects tab, where you can click on the project to open the base folder) Another addition, which would be nice: An ability to create a backup of the current installed Version, currently I keep track of this manually and create backups, but depending on how you plan to support multiple version channels, it might be nice to easy rollback to a previous one. (without hoping that you provide the correct version channel, maybe a simple zip file or tar) Project-Tab: The warning icons and delete button are not indicating, that they can be clicked and there is now real indicator what happens if you click them (tooltips to the rescue?) The delete icon should be replaced (in my opinion) with a trash bin or something like this. A hint, that the project is only removed from the project tab would be nice as well. Backup: The backup should be kept in a separate folder, which should mimic the original folder structure. The current system fills the dev folders with unnecessary files, which can make the fast searching in folders quite complicated. Also with version-control in mind, it would be easier to manage, if there is just a folder with the backed up files, which can be easily be deleted on demand. Currently, you need to filter all bak files and remove them, but this can also lead to problems if a developer maintains their own bak files.
-
added a moon with moon phases depending on the sun angle needs some tweaking and the light of the moon is not included yet.
-
signed distance fields can be used for much more than that. you can use it for every effect which needs to know here it collides with an object. eg: flow direction, or foam generation: they even can be used to make fast SSAO and other effects. So you should keep this in mind for later
-
Hi Josh, I have a small and i think simple feature request. If my assumption from your previous posts are correct, then all textures created within the context of ultraengine are already available in all shaders. This is similar to my investigations while debugging in the app. eg: the renderthreadmanager holds a reference for every texture and its type. I also have seen, that the underlying rednertexture has an ID which seems to be the correct index for the texturearray (2d,3d, cube). If that is correct, it would be nice to have this id directly accessable in the Texture class. Then you could easily pass that id too a posteffect shader. With the AddPostEffectParameter you mentioned in this thread.
-
By the way, it should be possible to create a full featured real-time sdf with the voxeldata of your vxrt implementation.
-
Signed distance field would be a great addition, they are pure gold for a lot of advanced effects.