Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Happy May Earthlings! I had another very busy month, but here's a brand new track for you on my Fantasy 13 page: "TROUBLE IN DREAMLAND" https://soundimage.org/fantasy-13/ As always, it's 100% free to use with attribution, like my thousands of other tracks. Enjoy! :-)
  3. Hi, i am new and rather inexperienced. installed UltraEngine Pro on Win11 VS2022 could not find ultraengine.h added extra include path in project settings and that solved it. Problem is that for every extra include path i add to the project, new missing include files pop up. New projects with Lua profile works fine, no problems there. Thanks in advance, Hasselmania
  4. Run this example and you will see that the capsule collider goes through the floor before it collides. May need to enable wireframe after it collides to see that it's below the floor. #include "Engine.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 framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 2, -6); camera->SetDebugPhysicsMode(true); //Create light auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 0); light->SetColor(3); auto floor = CreateBox(world, 100.0f, 0.1f, 100.0f); auto box = CreateCylinder(world, 0.5f, 1.8f); box->SetMass(1.0f); box->SetPosition(0, 4, 0); box->SetCollider(CreateCapsuleCollider(0.5f, 1.8f)); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  5. I believe we need a setter and getter for the pin, like for the plane joint. Other wise the only way to change this is to delete and reconstruct the plane joint. Joint::SetPin() Joint::GetPin()
  6. I was playing around with sliders and couldn't get the child object to collider with it's parent. This example here is the same. The green cube floats straight through the blue cube. At first I thought it was because the parent had no mass. But in my project, even if both child and parent have mass there is no collision between them. https://www.ultraengine.com/learn/CreateSliderJoint?lang=cpp
  7. This might do what I need. http://www.newtondynamics.com/wiki/index.php/NewtonConstraintCreateUserJoint I think we need a joint in Ultra that allows us to parent a physics object to anther physics object and still have everything work.
  8. I don't know if such a joint exists, but what I need is something that will allow me to spin a planet around with a kinematic joint and have all physics objects on the surface of that planet not move. In the video here gravity goes to the centre of the sphere. You can see once the small spheres come to a rest I start to spin the large sphere with the kinematic joint and the spheres on the surface begin to rotate. I understand that this is probably the correct behavior due to inertia and what not but I want to turn it off! I need a joint that I can use to parent lots of objects to one main physics object, that regardless of how I move that larger object the child physics objects will be constrained to it - but still react to physics! Pretty much being able to use Entity::SetParent() but not breaking physics, and having physics being able to run in local space to the parent. Is this something newton can do? I might post in the forums on Newton as well.
  9. 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.
  10. 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.
  11. SpiderPig

    Where will you go?

    That looks amazing 😍
  12. 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.
  13. Yesterday
  14. 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.
  15. 0.9.6 Full update with all recent fixes.
  16. 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...
  17. In my tests the problem is resolved. New build will go up later today with the fix.
  18. Can confirm, this is also happens within the editor. Also, a model loaded in a prefab file cannot be picked in the viewports.
  19. Josh

    Mobile Site

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