Jump to content

Josh

Staff
  • Posts

    22,903
  • Joined

  • Last visited

Everything posted by Josh

  1. Josh

    Thumbs

    Can you upload a model that reliably causes this error?
  2. I don't understand what is happening from this description. I have never seen such behavior. Is the grid visibility problem still happening now? We are on 0.9.3, on both stable and dev branches.
  3. The terrain shader was not set up to handle when a camera has lighting disabled, so it was just accessing random video memory in the light render function. It's super fast now. You need to sync your project to get the new shader.
  4. The map posted above runs fast when it is not selected, but performance slows down badly when it is selected. Behavior seems very odd, like it is disproportionately slower than simply a 2x render should be...
  5. Is it possible to get an example map that clearly demonstrates the issue, along with the materials and textures needed?
  6. Josh

    Thumbs

    This happens for all models, even the ones included in the project template?
  7. Issue is resolved.
  8. I just signed out and back in with no problem. Are you still unable to sign in?
  9. Version 0.9.3 is now live on the default branch.
  10. The animation system will automatically blend to make smooth transitions between animations: https://www.ultraengine.com/learn/Model_Animate You can also specify a "track" in that command to mix multiple animations at once.
  11. Current build is intended to be the final version of 0.9.3 and will go onto the stable branch soon.
  12. I can probably insert my own handling for convex hulls, but let's see if Julio responds first.
  13. I think there is still an issue. I just bumped it because this is one of the things that can maybe be solved in a couple days. The remaining bugs in this forum are all more involved, and I try to do the easiest fixes first.
  14. I made a demo, using the current code from Github. That's all I can do for now.
  15. Fixed. Cameras bounds will be treated as a single point for this functionality.
  16. Created a thread here: https://newtondynamics.com/forum/viewtopic.php?f=9&t=9832&p=67985#p67985 Perhaps related: http://newtondynamics.com/forum/viewtopic.php?f=12&t=9305&p=62960&hilit=NewtonCollisionPointDistance#p62960 I need to redownload Newton and see if my version matches the repo.
  17. This example better demonstrates the problem: #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 framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.8); camera->Move(3, 0, -2); camera->SetDebugPhysicsMode(true); camera->AddComponent<CameraControls>(); auto unlitMaterial = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.json"); unlitMaterial->SetShaderFamily(unlitShader); int width = 2, height = 1, length = 3; auto model = CreateModel(world); auto mesh = model->AddMesh(); mesh->AddVertex(0, 0, 0); //S mesh->AddVertex(-width * 0.5, -height * 0.5, length);//NW mesh->AddVertex(width * 0.5, -height * 0.5, length);//NE mesh->AddPrimitive(2, 1, 0);//S , NW, NE mesh->AddVertex(-width * 0.5, height * 0.5, length);//NW h mesh->AddVertex(width * 0.5, height * 0.5, length);//NE h mesh->AddPrimitive(0, 3, 4);//S , NW h, NE h mesh->AddPrimitive(0, 1, 3);//left mesh->AddPrimitive(4, 3, 1); //"face" mesh->AddPrimitive(2, 4, 1); //"face" mesh->AddPrimitive(0, 4, 2); //"right" world->SetAmbientLight(1); //auto& mat = unlitMaterial; auto mat = CreateMaterial(); mat->SetTransparent(true); model->SetMaterial(mat); //model->SetColor(0.5f, 0.8f, 0, 0.25f); model->SetPosition(0, 0, 0); auto collider = CreateConvexHullCollider(mesh); model->SetCollider(collider); Vec3 targetPos(-1, 0, 0); auto box = CreateBox(world, 0.1f); box->SetPosition(targetPos); auto mover = box->AddComponent<Mover>(); //mover->movementspeed.x = 0.2; model->Turn(0, 90, 0); auto ball = CreateSphere(world, 0.055); ball->SetColor(1, 0, 0); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { targetPos = box->GetPosition(); auto newTargetPos = TransformPoint(targetPos, nullptr, model); if (window->KeyDown(KEY_RIGHT)) box->Move(0.02, 0, 0); if (window->KeyDown(KEY_LEFT)) box->Move(-0.02, 0, 0); if (window->KeyDown(KEY_UP)) box->Move(0,0.02, 0); if (window->KeyDown(KEY_DOWN)) box->Move(0,-0.02, 0); auto p = model->GetCollider()->ClosestPoint(newTargetPos); p = TransformPoint(p, model, nullptr); ball->SetPosition(p); bool isInside = model->GetCollider()->IntersectsPoint(newTargetPos); if (isInside) { model->SetColor(0, 0.5, 0, 0.5); } else { model->SetColor(0.5, 0.5, 0.5, 0.5); } world->Update(); world->Render(framebuffer); } return 0; }
  18. Bumping this to top of list...
  19. It looks like the image indexes aren't correct and this is not a valid glTF file. I added some checks to prevent crashing, but the image indexes are wrong. It would appear this indicates an error in the Ultra glTF saver. If you can provide the original file, before it was saved from Ultra, I will test with that. The images section only contains four images: "images": [ { "uri": "PineLeaves_DIFF.png" }, { "uri": "PineLeaves_NORM.png" }, { "uri": "PineTrunk_DIFF.png" }, { "uri": "PineTrunk_NORM.png" } ], But the textures section is referencing images greater than 3: "textures": [ { "extensions": { "MSFT_texture_dds": { "source": 1 } }, "source": 0 }, { "extensions": { "MSFT_texture_dds": { "source": 3 } }, "source": 2 }, { "extensions": { "MSFT_texture_dds": { "source": 5 } }, "source": 4 }, { "extensions": { "MSFT_texture_dds": { "source": 7 } }, "source": 6 } ]
  20. LOD 1 and 2 load fine, although they are missing DDS textures...
  21. Easy fix. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the display list 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(); world->SetAmbientLight(0); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetFov(70); camera->SetPosition(0, 50, 0); camera->SetRotation(45, 0, 0); camera->SetClearColor(0.125); camera->SetSweptCulling(true); //Sunlight auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(2); //Create terrain auto terrain = CreateTerrain(world, 512); terrain->LoadHeightmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Terrain/512.r16"); terrain->SetScale(1, 100, 1); //Create base material auto ground = CreateMaterial(); auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_4k.dds"); auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_4k.dds"); ground->SetTexture(diffusemap, TEXTURE_BASE); ground->SetTexture(normalmap, TEXTURE_NORMAL); terrain->SetMaterial(ground); //Create paint material auto rocks = CreateMaterial(); diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k.dds"); normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_dot3.dds"); auto dispmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_disp.dds"); rocks->SetTexture(diffusemap, TEXTURE_BASE); rocks->SetTexture(normalmap, TEXTURE_NORMAL); rocks->SetTexture(dispmap, TEXTURE_DISPLACEMENT); int rocklayer = terrain->AddLayer(rocks); //Apply material based on terrain slope for (int x = 0; x < terrain->resolution.x; ++x) { for (int y = 0; y < terrain->resolution.y; ++y) { float slope = terrain->GetSlope(x, y); if (slope > 15.0f) { float wt = Min((slope - 15.0f) / 10.0f, 1.0f); terrain->SetLayerWeight(rocklayer, x, y, wt); } } } //Camera controls camera->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
×
×
  • Create New...