Jump to content

Josh

Staff
  • Posts

    24,629
  • Joined

  • Last visited

Everything posted by Josh

  1. This is one way of storing a wide string. I have switched the editor over to store UTF-8 strings, but the client may still use character arrays like above. I think I'll eventually move that over to UTF8 as well, but it's okay as long as its working.
  2. Seems to be fixed in current build.
  3. This seems to be working okay in current build.
  4. 1.0.3 Library updated with fixes for terrain heightmap loading, picking, and normals calculation.
  5. 1.0.3 Alpha mask fixed in PBR shader. Asset editor will no longer load additional model LOD levels. Fixed bug in gltf shader family paths when saved. Fixed calculation of camera depth range in asset editor.
  6. This is correct: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/MSFT_texture_dds
  7. The image "PineLeaves_DIFF.png" does not look like it has an alpha channel, or has a completely solid alpha channel.
  8. BTW, the asset editor will not load Lods when a model is loaded, since each LOD is contained in a separate file.
  9. I hacked it a bit to produce a valid file: { "accessors": [ { "bufferView": 0, "componentType": 5126, "count": 9231, "max": [ 3.081611156463623, 25.591766357421875, 3.6851890087127686 ], "min": [ -4.146778583526611, -1.0971499681472778, -3.647721290588379 ], "type": "VEC3" }, { "bufferView": 1, "componentType": 5121, "count": 9231, "type": "VEC3" }, { "bufferView": 2, "componentType": 5126, "count": 9231, "type": "VEC3" }, { "bufferView": 3, "componentType": 5121, "count": 9231, "type": "VEC3" }, { "bufferView": 4, "componentType": 5126, "count": 9231, "type": "VEC2" }, { "bufferView": 5, "componentType": 5121, "count": 9231, "type": "VEC3" }, { "bufferView": 6, "componentType": 5123, "count": 9759, "type": "SCALAR" }, { "bufferView": 7, "componentType": 5126, "count": 1472, "max": [ 0.35914069414138794, 25.17479705810547, 1.9243559837341309 ], "min": [ -1.3300083875656128, -0.49771878123283386, -1.2738277912139893 ], "type": "VEC3" }, { "bufferView": 8, "componentType": 5121, "count": 1472, "type": "VEC3" }, { "bufferView": 9, "componentType": 5126, "count": 1472, "type": "VEC3" }, { "bufferView": 10, "componentType": 5121, "count": 1472, "type": "VEC3" }, { "bufferView": 11, "componentType": 5126, "count": 1472, "type": "VEC2" }, { "bufferView": 12, "componentType": 5121, "count": 1472, "type": "VEC3" }, { "bufferView": 13, "componentType": 5123, "count": 2028, "type": "SCALAR" } ], "asset": { "generator": "Ultra Engine glTF Exporter", "version": "2.0" }, "bufferViews": [ { "buffer": 0, "byteLength": 110772, "byteOffset": 0 }, { "buffer": 0, "byteLength": 9231, "byteOffset": 110772 }, { "buffer": 0, "byteLength": 110772, "byteOffset": 138466 }, { "buffer": 0, "byteLength": 9231, "byteOffset": 249240 }, { "buffer": 0, "byteLength": 73848, "byteOffset": 276934 }, { "buffer": 0, "byteLength": 9231, "byteOffset": 350784 }, { "buffer": 0, "byteLength": 19518, "byteOffset": 378478 }, { "buffer": 0, "byteLength": 17664, "byteOffset": 397996 }, { "buffer": 0, "byteLength": 1472, "byteOffset": 415660 }, { "buffer": 0, "byteLength": 17664, "byteOffset": 420076 }, { "buffer": 0, "byteLength": 1472, "byteOffset": 437740 }, { "buffer": 0, "byteLength": 11776, "byteOffset": 442156 }, { "buffer": 0, "byteLength": 1472, "byteOffset": 453932 }, { "buffer": 0, "byteLength": 4056, "byteOffset": 458348 } ], "buffers": [ { "byteLength": 462404, "uri": "PineLarge_001.bin" } ], "extensionsUsed": [ "ULTRA_mesh_displacement", "MSFT_texture_dds", "ULTRA_extended_material" ], "images": [ { "uri": "PineLeaves_DIFF.png" }, { "uri": "PineLeaves_DIFF.dds" }, { "uri": "PineLeaves_NORM.png" }, { "uri": "PineLeaves_NORM.dds" }, { "uri": "PineTrunk_DIFF.png" }, { "uri": "PineTrunk_DIFF.dds" }, { "uri": "PineTrunk_NORM.png" }, { "uri": "PineTrunk_NORM.dds" } ], "materials": [ { "emissiveFactor": [ 0.007843137718737125, 0.007843137718737125, 0.007843137718737125 ], "extensions": { "ULTRA_extended_material": { "shaderFamily": "PBR", "shadow": true, "tessellation": false } }, "normalTexture": { "index": 1 }, "pbrMetallicRoughness": { "baseColorTexture": { "index": 0 }, "metallicFactor": 0.0, "roughnessFactor": 1.0 } }, { "extensions": { "ULTRA_extended_material": { "shaderFamily": "PBR", "shadow": true, "tessellation": false } }, "normalTexture": { "index": 3 }, "pbrMetallicRoughness": { "baseColorTexture": { "index": 2 }, "metallicFactor": 0.0, "roughnessFactor": 1.0 } } ], "meshes": [ { "primitives": [ { "attributes": { "NORMAL": 2, "POSITION": 0, "TEXCOORD_0": 4 }, "extensions": { "ULTRA_mesh_displacement": { "DISPLACEMENT": 5 } }, "indices": 6, "material": 0, "mode": 4 }, { "attributes": { "NORMAL": 9, "POSITION": 7, "TEXCOORD_0": 11 }, "extensions": { "ULTRA_mesh_displacement": { "DISPLACEMENT": 12 } }, "indices": 13, "material": 1, "mode": 4 } ] } ], "nodes": [ { "mesh": 0, "name": "PineLarge_001" } ], "scene": 0, "scenes": [ { "nodes": [ 0 ] } ], "textures": [ { "source": 0 }, { "source": 2 }, { "source": 4 }, { "source": 6 } ] }
  10. The file "PineLarge_001.gltf" is invalid. There are texture sources listed that exceed the size of the images array.
  11. This was happening because I changed the terrain data format to use half-floats, so there is no clamped range, and you can lower the ground as well as raise it. Fix is incoming...
  12. I uploaded it to the wrong folder. Try again please.
  13. Okay, I think it will work now. Update is available. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0]); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface auto ui = CreateInterface(world, font, framebuffer->size); //Create widget iVec2 sz = ui->root->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->root); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto quakeLoaderPlugin = LoadPlugin("Plugins/QuakeLoader"); //Load model WString path = "D:/SteamLibrary/steamapps/common/Quake/id1"; auto pak = LoadPackage(path + "/PAK0.PAK"); auto pixmap = LoadPixmap(path + "/gfx/bigbox.lmp"); Assert(pixmap); ui->root->SetPixmap(pixmap); //Create camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2, 0); while (true) { while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; default: ui->ProcessEvent(ev); break; } } world->Update(); world->Render(framebuffer); } return 0; }
  14. LMP isn't really a defined file format. This particular file reports that the width and height are both -1... https://six-of-one.github.io/quake-specifications/qkspec_3.htm#PLMP What is bigbox.lmp? Is it the background image?
  15. You know the asset editor can save materials, right?
  16. Looks like it's not currently loaded from files, but I will add it.
  17. It’s bc1/dxt1: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormat.html
  18. 1.0.3 Material color / intensity now works correctly in asset editor. Material shader family controls updated in asset editor, to treat shader family as a file that can be selected from any directory. Material emission property fixed.
  19. The design of this feature has been changed.
  20. You probably want Material::SetAlphaMask. Also, you probably want your transparent pixels to be greenish instead of black so the edges don't appear dark.
×
×
  • Create New...