Jump to content

All Activity

This stream auto-updates

  1. Today
  2. In the current builds (steam and standalone) the imposter generation is not working. If i use the "Tool->Generate imposter" the model is added correctly, but no imposter textures are generated. It seems that the required post effects (basecolor and world normals) for imposter generation are not provided.
  3. Josh

    Terrain normal matching

    Using the terrain normal for the grass normal seems to give the best result. I will probably add in some color variation on top of this.
  4. SpiderPig

    Where will you go?

    That looks amazing 😍
  5. 0.9.6 Added "Reset Transform" menu item in model editor tools menu. First implementation of imposters is ready. See Tools >Generate Imposter in model editor window. Note that foliage and imposters do not work together...yet.
  6. Yesterday
  7. 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.
  8. 0.9.6 Full update with all recent fixes.
  9. 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...
  10. In my tests the problem is resolved. New build will go up later today with the fix.
  11. Can confirm, this is also happens within the editor. Also, a model loaded in a prefab file cannot be picked in the viewports.
  12. Josh

    Mobile Site

    Yes, the custom skin removes a lot of things. This is an oversight that should be fixed in time.
  13. 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.
  14. 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.
  15. Yeah I think that's exactly what I need to do. Should be easier than writing out a 1000 line switch statement.
  16. 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; }
  17. Marking this as solved since I think it is...
  18. 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.
  19. 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.
  20. 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" } ] } }
  21. 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.
  22. 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.
  23. 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.
  1. Load more activity
×
×
  • Create New...