Jump to content

Josh

Staff
  • Posts

    23,085
  • Joined

  • Last visited

Everything posted by Josh

  1. Yes. Ultra is currently using Newton 3. Newton 4 is better at handling vehicles. I have it partially implemented, and I plan to make it so you can select the physics engine when the world is created.
  2. I have two goals for the art pipeline in the new game engine. Eliminate one-way 3D model conversions. Use the same game asset files on all platforms. In Leadwerks, 3D models get converted into the proprietary MDL format. Although the format is pretty straightforward and simple, there is no widespread support for loading it back into 3D modeling programs. This means you need to keep a copy of your 3D model in FBX and MDL format. You may possibly want to keep an additional file for the modeling program it was made in, such as 3D Studio Max MAX files. I wanted to simplify this by relying on the widely-support glTF file format, which can be used for final game-ready models, but can still easily loaded back into Blender or another program. Texture Compression Texture compression is where this all gets a lot more tricky. Texture compression is an important technique that can reduce video memory usage to about 25% what it would be otherwise. When texture compression is used games run faster, load faster, and look better because they can use higher resolution images. There are two problems with texture compression. Supported texture compression methods vary wildly across PC and mobile platforms. Many 3D modeling programs do not support modern texture compression formats. On the PC, BC7 is the best compression format to use for most images. BC5 is a two-channel format appropriate for normal maps, with Z reconstruction in the shader. BC6H can be used to compress HDR RGB images (mostly skyboxes). BC4 is a single-channel compressed format that is rarely used but could be useful for some special cases. The older DXTC formats should no longer be used, as they have worse artifacts with the same data size. Here are a few programs that do not support the newer BC formats, even though they are the standard for modern games: Windows Explorer Blender Microsoft 3D Object Viewer Now, the glTF model format does not actually support DDS format textures at all. The MSFT_texture_dds extension adds support for this by adding an extra image source into the file. glTF loaders that support this extension can load the DDS files, while programs that do not recognize this extension will ignore it and load the original PNG or JPEG files: "textures": [ { "source": 0, "extensions": { "MSFT_texture_dds": { "source": 1 } } } ], "images": [ { "uri": "defaultTexture.png" }, { "uri": "DDSTexture.dds" } ] I don't know any software that supports this extension except Ultra Engine. Even Microsoft's own 3D Object Viewer app does not support DDS files. The Ultra Engine editor has a feature that allows you to convert a model's textures to DDS. This will resave all textures in DDS format, and change the model materials to point to the DDS files instead of the original format the model uses (probably PNG): When a glTF file is saved after this step, the resulting glTF will keep copies of both the original PNG and the saved DDS files. The resulting glTF file can be loaded in Ultra Engine ready to use in your game, with DDS files applied, but it can still be loaded in programs that do not support DDS files, and the original PNG files will be used instead: The same model can be loaded back into Blender in case any changes need to be made. If you resave it, the references to the DDS images will be lost, so just repeat the DDS conversion step in the Ultra Engine to finalize the updated version of your model. To cut down on the size of your game files, you can just skip PNG files in the final packaging step so only DDS files are included. Basis Universal We still have to deal with the issue of hardware support for different codecs. This table from Unity's documentation shows the problem clearly: We do want to support some mobile-based VR platforms, so this is something that needs to be considered now. Basis Universal is a library from the author of Crunch that solves this problem by introducing a platform-agnostic intermediate compressed format that can be quickly transcoded into various texture compression formats, without going through a slow decompression and recompression step. We can generate Basis files in the Ultra Engine editor just like we did for DDS: There is a glTF extension that supports basis textures, so glTF models can be saved that reference the Basis files. The basis textures are stored in the glTF file the same way the DDS extension works: "textures": [ { "source": 0, "extensions": { "KHR_texture_basisu": { "source": 1 } } } ], "images": [ { "mimeType": "image/png", "bufferView": 1 }, { "mimeType": "image/ktx2", "bufferView": 2 } ] The resulting glTF files can be loaded as game-ready models with compressed textures on PC or mobile platforms, and can still be loaded back into Blender or another 3D modeling program. We don't have to store different copies of our textures in different compression formats or go through a slow conversion step when publishing the game to other platforms. If your game is only intended to run on PC platforms, then DDS is the simplest path to take, but if you plan to support mobile-based VR devices in the future then Basis solves that problem nicely. Here is our revised table: I was also working with the KTX2 format for a while, but I ended up only using it for its support for Basis compression. DDS and Basis cover all your needs and are more widely supported. Basis also supports a very lossy but efficient ETC1S method which is similar to Crunch, as well as uncompressed texture data, but in my opinion the one purpose for the Basis format is its UASTC format. This article features the lantern sample glTF model from Microsoft.
  3. Updated 1.0.2 Added Asset::GetPackage method Added Asset::packagepath member Fixed problems in OBJ loader and saver OBJ and glTF saving will now reconstruct Z component of converted BC5 textures OBJ loader will now create fewer vertices Added Stream::Align Fixed glTF byteOffset validation error Fixed reversed vertex X position in glTF export Added support for Microsoft DDS extension in glTF export Removed KTX2 plugin Added Basis Universal plugin Added support for KHR_texture_basisu in glTF loader/saver Fixed glTF save not writing object positions Fixed glTF save not including emissive textures Added support for our own ULTRA_triangle_quads extension for packing quad meshes in glTF files Fixed problems with Model::Collapse method Fixed TEXTURE_RG read/write/convert Added some missing shader combos when tessellation is used
  4. Will be fixed in the next build...
  5. camera->SetViewport(200, 0, framebuffer->size.x - 200, framebuffer->size.y); If you call that code again after the new framebuffer is created, it works perfectly.
  6. Josh

    Asset Explorer

    We can see here there are 12 meshes but only 10 materials, so this model would be a little more efficient if we just collapse and resave it.
  7. Josh

    Asset Explorer

    Working out the model and material editing interfaces. There's a lot of little details to attend to, especially in the import/export features. I'd say the asset browser / editor is probably about 50% of the complexity of the entire editor.
  8. It's also worth noting that in desktop mode menus and comboboxes use a separate window for the pop-up component, so there is no problems with these things appearing on top of a child window. However, this is not true when the GUI is being rendered in Vulkan.
  9. Sure, if you write a plugin for your file format.
  10. Josh

    Material Editor Interface

    Of course! It's a combination of a per-camera setting and a per-material setting.
  11. Josh

    Dungeon Skank

    This would be very interesting in VR.
  12. If you are doing marching cubes, maybe it is possible to calculate the normals from the underlying volumetric geometry instead of trying to calculate them from the mesh? I mean you lose information when you go from volumetric to mesh, so maybe before losing that information it is possible to calculate normals that should be applied to the mesh?
  13. Josh

    Copy pixel

    I think render-to-texture is a lot more well explained and refined in Ultra.
  14. Josh

    Copy pixel

    This should do it: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Camera_SetRenderTarget
  15. My first reason was "jut use printf" but the Print() command actually does a lot more than that. It calls OutputDebugString so the text appears int he VS console. It also can run hooks. So yes, I agree with you.
  16. Another thing you can do is just make a program act different based on command line params. I think I am going to make the editor call launch its own executable to generate thumbnail images. This saves me from having to include two large EXEs.
  17. I also use Ultra App Kit for simple programs that don't need 3D.
  18. Josh

    Texture Manager WIP

    This is what I want the first editor build to be. If I can polish up an app that just browses the game directory and handles textures, that is a good first milestone.
  19. Rearranged some screen elements and now it's a whole new application.
  20. Josh

    Weird

    Upload please!
  21. Here we can see the file time and size imported from the package. Labels for the file, folder, and package are displayed in the side panel.
×
×
  • Create New...