Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. A quick overview of imposters, a nifty little built-in feature coming soon. This is mostly meant for use with the foliage system, but it works with regular models as well.
  3. Today
  4. 0.9.6 Full update with all recent fixes.
  5. I notice that FirstPersonControls::Start() is being called five times. If I put this code in the update function, I can see there are two copies of the object being updated each frame: void FirstPersonControls::Update() { Print(uint64_t(this)); 1681950787280 1681952725632 1681950787280 1681952725632 1681950787280 1681952725632 1681950787280 Let me figure out why...
  6. In my tests the problem is resolved. New build will go up later today with the fix.
  7. Can confirm, this is also happens within the editor. Also, a model loaded in a prefab file cannot be picked in the viewports.
  8. Josh

    Mobile Site

    Yes, the custom skin removes a lot of things. This is an oversight that should be fixed in time.
  9. When accessing UltraEngine.com via mobile there is no where to log in. I had to go through the learn docs to find a link that took me to a sign up page. There I found a sign in link but there's nothing on the main page. Once signed in there's also no apparent way to access your messages.
  10. Pretty sure I got it working. I'll test it a bit more before bringing in the game though. There is a switch statement for the change in the UP vector. Depending on what axis is UP currently to what axis is the target UP direction dictates what the rotation matrix should be for both the forward and side vectors. Should work for a round planet too.
  11. Yeah I think that's exactly what I need to do. Should be easier than writing out a 1000 line switch statement.
  12. Thanks! Updated loops as it was in Outline.frag and now it works. I did not that before because it looked wrong but with unlit sprite now it's looks as should be. Updated shader code: #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() { vec2 BufferSize = vec2(DrawViewport.z, DrawViewport.w); ivec2 coord = ivec2(gl_FragCoord.x, gl_FragCoord.y); outColor = vec4(0.0f); int count = textureSamples(DepthBuffer); const int m = max(0, (Thickness - 1) / 2); float depth; //Handle selected objects for (int n = 0; n < count; ++n) { bool done = false; depth = texelFetch(DepthBuffer, coord, n).r; if (depth < 1.0f) { 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); done = true; break; } } if (done) break; } } } outColor /= float(count); } Updated example: #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(); world->RecordStats(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(50); camera->SetPosition(0, 0, -3); //Create a light auto light = CreateDirectionalLight(world); light->SetColor(1); //Create a box auto box = CreateBox(world); box->SetColor(1, 0, 0); auto outlineBox = CreateBox(world); outlineBox->SetColor(0, 1, 0); box->SetPosition(-1, 0, 0); auto material = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.fam"); material->SetShaderFamily(unlitShader); outlineBox->SetMaterial(material); outlineBox->SetPosition(box->GetPosition()); outlineBox->SetParent(box); //Create a box2 auto box2 = CreateBox(world); box2->SetColor(1, 0, 0); auto outlineBox2 = CreateBox(world); outlineBox2->SetColor(0, 0, 1); auto material2 = CreateMaterial(); material2->SetShaderFamily(unlitShader); outlineBox2->SetMaterial(material); box2->SetPosition(1, 0, 0); outlineBox2->SetPosition(1, 0, 0); outlineBox2->SetParent(box2); //Entity component system auto component = box->AddComponent<Mover>(); component->rotationspeed.y = 45; auto component2 = box2->AddComponent<Mover>(); component2->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")); cam2->SetLighting(false); cam2->SetUniform(0, "Thickness", 10); auto sz = framebuffer->GetSize(); auto texbuffer = CreateTextureBuffer(sz.x, sz.y); auto pixels = CreatePixmap(sz.x, sz.y, TEXTURE_RGBA); auto tex = CreateTexture(TEXTURE_2D, sz.x, sz.y, pixels->format, { pixels }, 1, TEXTURE_DEFAULT, TEXTUREFILTER_NEAREST); texbuffer->SetColorAttachment(tex); cam2->SetRenderTarget(texbuffer); ////Display overlay auto sprite = CreateSprite(world, sz.x, sz.y); sprite->SetRenderLayers(4); auto mtl = CreateMaterial(); mtl->SetShaderFamily(unlitShader); mtl->SetTransparent(true); mtl->SetTexture(texbuffer->GetColorAttachment()); sprite->SetMaterial(mtl); auto cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); cam3->SetClearMode(CLEAR_DEPTH); cam3->SetRenderLayers(4); cam3->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); cam3->SetLighting(false); //------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer, false); window->SetText(world->renderstats.framerate); } return 0; }
  13. Marking this as solved since I think it is...
  14. Okay, the problem is that Entity::Copy() was not copying the tags. I believe this will be fixed in the next build that goes up.
  15. Okay, the problem is that Entity::Copy() was not copying the tags. I believe this will be fixed in the next build that goes up.
  16. Tags are being saved in the map file, and if I load the prefab like a map (File > Open) the tags load, but when objects are placed in the scene the tags are missing. { "scene": { "entities": [ { "castshadows": true, "collisiontype": 1, "extras": {}, "friction": [ 0.5, 0.8999999761581421 ], "group": "1663675869920", "kids": [ { "castshadows": true, "collisiontype": 1, "extras": {}, "friction": [ 0.5, 0.8999999761581421 ], "matrix": [ "0x42c80000", "0x0", "0x0", "0x0", "0x0", "0xb747ffff", "0x42c7fffe", "0x0", "0x0", "0xc2c7fffe", "0xb747ffff", "0x0", "0x0", "0x0", "0x0", "0x3f800000" ], "model": { "islimb": true }, "name": "Cube", "physicsmode": 0, "pickmode": 1, "quaternion": [ "0x3f3504f4", "0x0", "0x0", "0xbf3504f2" ], "reflection": true, "rotation": [ "0x42b3f5df", "0x80000000", "0x0" ], "scale": [ "0x42c80000", "0x42c7ffff", "0x42c7ffff" ], "tags": [ "test2" ], "uuid": "d0a578c6-4ac8-4de5-83e0-85db59a8a57b" } ], "model": { "islimb": false, "path": "Models/test.mdl" }, "name": "STATIC_MESH", "physicsmode": 0, "pickmode": 1, "reflection": true, "tags": [ "test1" ], "uuid": "bc1b377d-116b-45d8-b6dd-5eb8f8330079" } ] } }
  17. It's working fine for me within the editor, with this test: tagtest.zip Note that if you just click on the object, both the parent and child will be selected, and the tags property field will appear empty because the two selected objects have different values.
  18. Make sure you compare your shader code to my current shader. I had a similar problem with outline colors in the editor, due to some errors in the logic for the loops.
  19. Almost there - colors still a little bit off: I use different colors, not only full red/green etc. so it's not an option for me i guess. I will try to experiment a bit with a shader code now.
  20. ErhanK

    Quake BSP Loading

    Sorry.. my mistake. I should have tried another bsp. It worked now, thanks.
  21. Was this only occurring when the game is launched from the editor? We had a problem where the process was being blocked because its output pipe was not being read by the editor after launching, which would cause the game to freeze on a print command. This was recently fixed. Does this happen when running the game from Visual Studio, or only when launching from in the editor?
  22. Josh

    Quake BSP Loading

    Here is an example that uses another plugin to load PNG images in a glTF file: https://www.ultraengine.com/learn/LoadPlugin?lang=cpp
  23. Josh

    Quake BSP Loading

    Just call LoadPlugin("Plugins/QuakeLoader.dll"), make sure you keep it in memory, and call LoadModel() to load a quake bsp file as a model.
  24. ErhanK

    Quake BSP Loading

    I installed the plugin, but I'm not sure which functions to call and create a model from BSP. Do you have an article for this?
  1. Load more activity
×
×
  • Create New...