Jump to content

Josh

Staff
  • Posts

    22,903
  • Joined

  • Last visited

Everything posted by Josh

  1. @klepto2As discussed, Texture::GetVKTexture() has been replaced with these: virtual VkImage GetImage(); virtual VkSampler GetSampler(); These are actually safe to call in the main thread if asynchronous rendering is disabled.
  2. You can also try the Ultra Engine versions of the benchmark tests I uploaded here: https://github.com/UltraEngine/Benchmarks
  3. I want to start some more widespread compatibility testing. The only issue I have seen is that some GPUs have strange configurations I have not encountered yet. These issues are usually easy to fix once I see what is happening. Please give this a try: test.zip System requirements are Windows 10 and a discrete GPU that supports Vulkan 1.3. This is a simple graphics initialization test. If it starts correctly it will look like this:
  4. New update Fixed bug where animation was not loading from Leadwerks MDL/GMF files Fixed bug where copied models were not visible The Ultra Engine project files for the benchmarks are now available: https://github.com/UltraEngine/Benchmarks/tree/main/Project Files/Ultra Engine Unity project files are here: https://github.com/UltraEngine/Benchmarks/tree/main/Project Files/Unity
  5. I think that should still be fine. You might want to make your terrain subdivisions arbitrary so you can easily change the subdivision to test what works best. If there is a problem you will see it in the framerate. This is completely unrelated to your game loop speed, so make sure you know what you are measuring the timing of.
  6. I don't see how you can resize those members because the public members are read-only. Data transfer at that level should be no problem at all. I don't know the exact size of the vertex structure, but it's probably somewhere around 72 bytes, so 1000 vertices is only 70 Kb of data.
  7. Something else that might be relevant to you: Mesh size in Ultra is fixed. Once the mesh is submitted to the rendering thread you can't add vertices or primitives. This allows the renderer to offload additional overhead onto the culling thread. You can modify the vertices and indices of a mesh. So if you want to change a mesh into a new one, you can do this: If the new mesh is bigger than the existing mesh, there is nothing you can do except use the new one. If the new mesh is the same size as the existing mesh, you can just copy the vertices and indices data with a memcpy, and call one command to trigger a mesh re-submit, like SetVertexPosition(). If the new mesh is smaller than the existing mesh, you can do the above, and for all the unused vertices at the end you can just set their positions to zero. Over time the mesh size will grow so that the first scenario in this list stops happening. This is how I implemented Sprite::SetText().
  8. And once you do that, you also have multiple threads at your disposal: https://www.ultraengine.com/learn/Thread?lang=cpp I would keep a group of threads ready and use a semaphore to signal to them when they have new data to process, and then each thread should signal another semaphore indicating they are finished processing. Don't continuously create new threads.
  9. You might be surprised how efficient C++ code can be when you start optimizing hard. I would try this route first. I had some terrain splatting code I thought had to be done in a compute shader. My first step was to refactor the code so it would operate more like a shader. Low and behold when I did that it ran so fast I no longer needed the shader. For high performance C++ you can basically assume that math operations are free but memory and stack allocations are costly. If you are adding components to an STL vector, use reserve() to preallocate a larger block of memory. std::vector<int> a; a.reserve(1000); for (int n = 0; n < 1000; ++n) { a.push_back(n) } If you don't know the final length of the vector you can do this: while (something) { if (a.capacity() == a.size()) a.reserve(a.size() * 1.3f); a.push_back(n) } Declare variables outside of a loop, never inside. float a; for (int x = 0; x < 1000; ++x) { a = whatever; } Avoid use of Vec2 / Vec3 / Vec4 math that results in new objects behind created. For example this: v *= 3.0f; is much better than this: v = v * 3.0f; Avoid square roots when possible. If you want to test distances, you can get the squared length of a vector like this and test it against the distance squared: float lengthsquared = v.Dot(v); If you are iterating through a container of objects, this is your best friend: for (auto& thing : list) { thing.x = 2; }
  10. This example demonstrates the utility of the entity component system. When the object is copied, the member value we set in C++ code is also copied like magic: https://www.ultraengine.com/learn/Actor_Copy?lang=cpp
  11. New update Fixed point lights not getting a shadow refresh triggered when an object moved. Fixed static shadow cache, so this rather nice example now works correctly: https://www.ultraengine.com/learn/Entity_Staticize?lang=cpp Removed CurveAngle, added MixAngle.
  12. Here is a bunch of components I don't even remember writing. Maybe someone feels like looking through them to find what they think would be useful to include by default: Components.zip
  13. No, that is very shiny terrain. However, it does demonstrate that there is no need for any special water reflection technique in Ultra, since the default PBR reflections look quite good.
  14. I can reproduce the problem. Let me see what is going on here... #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("Terrain Paint", 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->SetFOV(70); camera->SetPosition(0, 60, -60); camera->SetRotation(-45, 0, 0); camera->SetClearColor(0.125); //Sunlight auto light = CreateDirectionalLight(world); light->SetRotation(65, 35, 0); //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_DIFFUSE); ground->SetTexture(normalmap, TEXTURE_NORMAL); ground->SetMetalness(0); ground->SetRoughness(1); terrain->SetMaterial(ground); world->SetEnvironmentMap(LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Environment/Storm/specular.dds"), ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Environment/Storm/diffse.dds"), ENVIRONMENTMAP_DIFFUSE); //Camera controls auto actor = CreateActor(camera); actor->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  15. Shaders updated. All the terrain examples should be working now.
  16. Ultra Engine is a new software that will only be sold on our site on a subscription basis at $9.99 a month. During the "early access" phase the price will be reduced to $7.99, and users will keep the lower price as long as their plan remains active. The early access release will be a C++ programming SDK for Windows. There is a new editor in development, but in the meantime the Leadwerks editor is largely compatible. Ultra Engine was invented to solve the performance problems I saw while working on VR projects at NASA. The engine delivers 10x faster performance than Leadwerks or Unity: Additionally, it gives the user a lot more control over every aspect of the engine, with terrain materials being one example.
  17. In the upcoming Ultra Engine, which is compatible with Leadwerks file formats, there are commands to get the terrain materials and weights at each point: https://www.ultraengine.com/learn/Terrain_GetMaterials?lang=cpp https://www.ultraengine.com/learn/Terrain_GetMaterialWeight?lang=cpp
  18. Josh

    Physics damage

    Speed of collision squared times object mass equals kinetic energy, which is equivalent to how much damage it would cause: KE = m * v * v This is why a head-on car collision at 80 MPH is four times worse than a collision at 40 MPH. The Script:Collision function will give you the speed.
  19. There is entity->body->Active() but it's only in C++. If GetVelocity() returns (0,0,0) that might be about the same thing.
  20. CurveValue was removed because it's the same thing as Mix() if you just flip the last argument: CurveValue(0.0f, 20.0f, 10.0f) is the same thing as Mix(0.0f, 20.0f, 1.0f / 10.0f) I think CurveAngle should also be removed and replaced with this: Mix(a, a + DeltaAngle(a, b), 1.0f / amount) Or maybe MixAngle(a, b, 1.0f / amount).
  21. @SpiderPig The backup files are working as intended, but I agree that it turns into a lot of unwanted garbage in your game's folder and should be changed. The vcxproj and filters files were modified to add the CameraControls component into the project. If you press the diff button for both those files you can see what was changed and insert in the changes if you want them. If you then save the files, it should stop considering them to be outdated.
  22. An update is available. This makes some small API changes to bring the engine inline with the online documentation. Camera::UpdateControls() is removed and a CameraControls component is added to the project template. Some small changes tot he component system as well. Component now has an "actor" member, instead of having to call GetActor(). The preprocessor source code is available here: https://github.com/UltraEngine/Preprocessor I also noticed the default project was not set up to call the precompiler at all! So this would prevent any new components from being evaluated. I think @reepblue mentioned this a while back. I fixed this and removed the premade ComponentSystem header and source files, so the project won't compile at all unless the precompiler is called successfully. Some of the terrain examples are currently not working, FYI...should be easy to fix.
  23. Josh

    Josh 3D Avatar

    It's perfect. 😝
  24. I can't say for sure if this will work in Leadwerks, but in Ultra you can add a spring to a hinge joint: https://www.ultraengine.com/learn/Joint_SetSpring?lang=cpp You could create a hinge that rotates left and right, and then on the child entity add a hinge that rotates forward and back, with a spring on both. This would act like a ball joint with no twisting.
×
×
  • Create New...