Jump to content

Dreikblack

Members
  • Posts

    315
  • Joined

  • Last visited

Everything posted by Dreikblack

  1. Fxied MultipleOutlines.frag: #version 450 #extension GL_ARB_separate_shader_objects : enable layout(binding = 0) uniform sampler2DMS DepthBuffer; layout(binding = 1) uniform sampler2D ColorBuffer; uniform int Thickness = 5; #include "../Base/CameraInfo.glsl" #include "../Utilities/Dither.glsl" #include "../Utilities/DepthFunctions.glsl" layout(location = 0) out vec4 outColor; void main() { ivec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y); outColor = vec4(0.0f); int count = textureSamples(DepthBuffer); float depth; //Handle selected objects for (int n = 0; n < count; ++n) { depth = texelFetch(DepthBuffer, coord, n).r; if (depth < 1.0f) { const int m = max(0, (Thickness - 1) / 2); vec2 pixelsize = vec2(1.0f) / BufferSize; for (int x = -m; x <= m; ++x) { for (int y = -m; y <= m; ++y) { if (x == 0 && y == 0) continue; float neighbour = texelFetch(DepthBuffer, coord + ivec2(x, y), n).r; if (neighbour == 1.0f) { outColor += texelFetch(ColorBuffer, coord, gl_SampleID); break; } } } } } outColor /= float(count); }
  2. It was just showing a visual issues. Anyway these issues seems to be resolved. I even managed to fix my multi outlines shader as well by researching a delta in usual outline shader
  3. Was it supposed to be included in last update? Because it's not a case for me
  4. With last update without assimp issue still there
  5. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto package = LoadPackage("Data.zip"); if (package == nullptr) { Notify("No Package Found"); } package->FileType(""); auto plugin = LoadPlugin("Plugin\\FITextureLoader"); if (!plugin) Notify("No plugin Found"); else Notify("Plugin Found"); auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 500, 500, displays[0], WINDOW_DEFAULT); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); auto font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); ui->LoadColorScheme("Style.json"); auto btn = CreateButton("TEST", 10, 10, 100, 100, ui->root); auto dir = LoadDir("Ru"); for (WString localFile : dir) { btn->SetText(localFile); Print(localFile); } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Data.zip
  6. After one of last updates outline shader got couple bugs: 1. Color is darker than should be 2. Outline not match model edge fully 3. Also for some reason it's looks thinner (1 pixel) than should be with same value of Thickness (3) #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //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->SetFov(70); camera->SetPosition(1, 0, -2); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); Vec4 color(0, 1, 0, 1); //Create a box auto box = CreateBox(world); //Render to texture box->SetRenderLayers(1 + 2); auto cam2 = CreateCamera(world); cam2->SetClearColor(0, 0, 0, 0); cam2->SetRenderLayers(2); cam2->SetFov(camera->GetFov()); cam2->SetMatrix(camera->matrix); cam2->AddPostEffect(LoadPostEffect("Shaders/Outline.fx")); auto sz = framebuffer->GetSize(); auto texbuffer = CreateTextureBuffer(sz.x, sz.y); cam2->SetRenderTarget(texbuffer); //Display overlay auto sprite = CreateSprite(world, sz.x, sz.y); sprite->SetColor(color); sprite->SetRenderLayers(4); auto mtl = CreateMaterial(); sprite->SetMaterial(mtl); mtl->SetTransparent(true); mtl->SetTexture(texbuffer->GetColorAttachment()); auto cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); cam3->SetClearMode(CLEAR_DEPTH); cam3->SetRenderLayers(4); cam3->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); auto box2 = CreateBox(world); box2->SetPosition(1, 0, 0); box2->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  7. 1) entity.name = "name" 2) Only in maps - map.entities. For World only tagged and in area 3) Just set an integer bigger than 6 with Entity:SetCollisionType. btw @Josh CollisionType enum seems being not exposed in LUA local NEW_COLLISION = 7 box1:SetCollisionType(NEW_COLLISION) https://www.ultraengine.com/learn/Entity_SetCollisionType?lang=lua https://www.ultraengine.com/learn/World_SetCollisionResponse?lang=lua 4) No GetTag() atm but it should be possible to iterate entity.tags but in my test example it return nil so probably not exposed in LUA @Josh 5) Not sure what you mean Maybe you want that: for n, entity in pairs(world:GetTaggedEntities("tag")) do local entity = Entity(entity) Print(entity.name) end
  8. Also GetFont() method would be nice to have for Interface #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0]); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); //Create main camera auto camera = CreateCamera(world); camera->SetPosition(0, 0, -3); auto font = LoadFont("Fonts/arial.ttf"); //Create user interface with a semi-transparent background auto ui = CreateInterface(world, font, framebuffer->size); ui->background->SetColor(0, 0, 0, 0.5); //Create widget iVec2 sz = ui->background->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->background); //Create camera auto orthocamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); orthocamera->SetClearMode(CLEAR_DEPTH); orthocamera->SetPosition(float(framebuffer->size.x) * 0.5f, float(framebuffer->size.y) * 0.5f, 0); //UI will only appear in orthographic camera orthocamera->SetRenderLayers(2); ui->SetRenderLayers(2); if (!button->GetFont()) Notify("Font is null"); else { Notify("Font is not null"); } while (true) { world->Update(); world->Render(framebuffer); } return 0; }
  9. No problems in C++ version but in LUA i have same issue with this code
  10. I thought i got answer in discord already. SetParent(nil) and widgetVar = nil, if you kept it somewhere
  11. Something wrong in latest beta updates again. Color is black instead of entity color: Also strange bottom edge, same with usual outline (color works tho for usual outline) Definitely used to work at 17 March but idk which exactly update changed it. Felt something wrong in my game last few days but noticed only now what's wrong. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1200, 800, 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 = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); //Create a box auto box = CreateBox(world); box->SetColor(1, 0, 0); auto outlineBox = CreateBox(world); outlineBox->SetColor(0, 1, 0); auto material = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.fam"); material->SetShaderFamily(unlitShader); outlineBox->SetMaterial(material); //Create a box2 auto box2 = CreateBox(world); box2->SetColor(1, 0, 0); auto outlineBox2 = CreateBox(world); outlineBox2->SetColor(0, 0, 1); auto material2 = CreateMaterial(); auto unlitShader2 = LoadShaderFamily("Shaders/Unlit.fam"); material2->SetShaderFamily(unlitShader); outlineBox2->SetMaterial(material); outlineBox2->SetPosition(2, 0, 0); box2->SetPosition(2, 0, 0); //Entity component system auto component = box->AddComponent<Mover>(); component->rotationspeed.y = 45; auto outlineComponent = outlineBox->AddComponent<Mover>(); outlineComponent->rotationspeed.y = 45; auto component2 = box2->AddComponent<Mover>(); component2->rotationspeed.y = 45; auto outlineComponent2 = outlineBox2->AddComponent<Mover>(); outlineComponent2->rotationspeed.y = 45; //------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ //Render to texture outlineBox->SetRenderLayers(2); outlineBox2->SetRenderLayers(2); auto cam2 = CreateCamera(world); cam2->SetClearColor(0, 0, 0, 0); cam2->SetRenderLayers(2); cam2->SetFov(camera->GetFov()); cam2->SetMatrix(camera->matrix); cam2->AddPostEffect(LoadPostEffect("Shaders/MultipleOutlines.fx")); auto sz = framebuffer->GetSize(); auto texbuffer = CreateTextureBuffer(sz.x, sz.y); cam2->SetRenderTarget(texbuffer); ////Display overlay auto sprite = CreateSprite(world, sz.x, sz.y); sprite->SetRenderLayers(4); auto mtl = CreateMaterial(); sprite->SetMaterial(mtl); mtl->SetTransparent(true); mtl->SetTexture(texbuffer->GetColorAttachment()); auto cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); cam3->SetClearMode(CLEAR_DEPTH); cam3->SetRenderLayers(4); cam3->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); //------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer, false); } return 0; } MultipleOutlines.frag: #version 450 #extension GL_ARB_separate_shader_objects : enable #define UNIFORMSTARTINDEX 1 #include "../Base/CameraInfo.glsl" #include "../Utilities/Dither.glsl" #include "../Utilities/DepthFunctions.glsl" layout(location = 0) out vec4 outColor; // Uniforms layout(location = 20, binding = 0) uniform sampler2DMS DepthBuffer; layout(location = 24) uniform int Thickness = 3; // should be an odd number layout(binding = 1) uniform sampler2DMS ColorBuffer; void main() { ivec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y); outColor = texelFetch(ColorBuffer, coord, gl_SampleID); outColor.a = 0.0f; float depth = texelFetch(DepthBuffer, coord, gl_SampleID).r; //Handle selected objects if (depth < 1.0f) { const int m = max(0, (Thickness - 1) / 2); vec2 pixelsize = vec2(1.0f) / BufferSize; for (int x = -m; x <= m; ++x) { for (int y = -m; y <= m; ++y) { if (x == 0 && y == 0) continue; float neighbour = texelFetch(DepthBuffer, coord + ivec2(x, y), gl_SampleID).r; if (neighbour == 1.0f) { outColor = texelFetch(ColorBuffer, coord, gl_SampleID); return; } } } } } MultipleOutlines.fx { "posteffect": { "buffers": [ { "size": [ 0.25, 0.25 ] } ], "subpasses": [ { "samplers": [ "DEPTH", "PREVPASS" ], "shader": { "float32": { "fragment": "Shaders/PostEffects/MultipleOutlines.frag" } } } ] } }
  12. - Changed font to OpenSans with my capital letters that looks Quakish - Perception system for AI - bots can now see (in 180 degrees at front if they did not detect enemies yet) , smell (in full circle), hear - When bots spot enemies via this way perception icon appears above unit for a sec - Spotted enemies bots keep in memory with last known positions. This memory is used if no enemies can be seen - In such cases ! icon will be visible until bot find enemy - If no enemies spotted but a bot still active ! icon appears. Crossed eye when becomes passive after 3 rounds - Using a zip archive now for files that can be loaded in this way atm Link to last build: https://drive.google.com/drive/folders/1d5QKGvv0ikCDG9Pe1gIS8sg0hhkbybn_?usp=sharing
  13. Also LoadCursorFromFileW() does not load an icon from zip. But it's WinUser class tho.
  14. What about issue with Style.json not being loaded from archive?
  15. I would say brush should share shape, size, materials and uv/texture mapping. idk yet if it should otherwise in some cases.
  16. Style should make UI looks brown (to check if it's loaded correctly) Also file name is looks wrong if it's not Latin symbolsData.zip #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto package = LoadPackage("Data.zip"); if (package == nullptr) { Notify("No Package Found"); } package->FileType(""); auto plugin = LoadPlugin("Plugin\\FITextureLoader"); if (!plugin) Notify("No plugin Found"); else Notify("Plugin Found"); auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 500, 500, displays[0], WINDOW_DEFAULT); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); auto font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); ui->LoadColorScheme("Style.json"); auto btn = CreateButton("TEST", 10, 10, 100, 100, ui->root); auto dir = LoadDir("Ru"); for (WString localFile : dir) { btn->SetText(localFile); Print(localFile); } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  17. Still not working after latest update
  18. 1. Applied trigger mat to a box brush 2. Fixed UV with face tool (right brush) 3. Saved as prefab 4. Dragged prefab into scene - it look like below. After dragging it's changing UV again and may become as at left After reopening map UV changes again and looks like at bottom one.
  19. After VS update i managed to build a projects
  20. I'm using VS 2022 17.6.4. Created a new project - same error.
  21. "Il mismatch between 'P1' version '20230904' and 'P2' version '20221215'"
×
×
  • Create New...