Jump to content

Josh

Staff
  • Posts

    24,625
  • Joined

  • Last visited

Everything posted by Josh

  1. Confirmed...I am guessing this is probably because the object was set to be static before it was saved, and the loader is making it static when it loads...
  2. I tried creating a simple map with this model and collision worked as expect, both between a first-person controller and the object, and between a static and dynamic instance of the model. How can I make this error occur? collisiontest.zip
  3. And then to download an individual file, you can use this function: bool DownloadSketchFabFile(const String& apikey, const String& uid, const WString& localpath) { String command = "curl -H \"Authorization: Token " + apikey + "\" https://api.sketchfab.com/v3/models/" + uid + "/download"; auto stream = CreateBufferStream(); auto err = Command(command, stream); if (err != 0) { Print("Error: " + String(err)); return false; } String s = stream->ReadString(); table t = LoadTable(s); if (not t.is_object()) { Print("Error: JSON data not returned"); return false; } if (not t["glb"].is_object()) { if (t["detail"].is_string()) { Print("Error: " + std::string(t["detail"])); return false; } Print("Error: glb object not found in response"); return false; } std::string url = std::string(t["glb"]["url"]); if (not DownloadFile(url, localpath)) { Print("Can't download file " + url); return false; } return true; } Example usage: // Get your API key here : https://sketchfab.com/settings/password String uid = "f12e67159f75486bb21213e573520612"; WString localpath = GetPath(PATH_DESKTOP) + "/" + uid + ".glb"; DownloadSketchFabFile(APIKey, uid, localpath); RunFile(localpath); You can get an API key here: https://sketchfab.com/settings/password Please only use this code within the terms of the SketchFab user agreement.
  4. This code can be used to download metadata from Sketchfab files. Each saved JSON file includes all the information associated with that model. An API key is not required at this step. Most importantly, this code will save your progress as you go, so if the process is interrupted for any reason you can pick it back up later without losing your place. Several settings are supported, and each combination of settings will save a different set of data that can be resumed at any time. Please only use this code within the bounds of the SketchFab user agreement. #include "UltraEngine.h" using namespace UltraEngine; // API documentation: https://docs.sketchfab.com/data-api/v3/index.html // Path to save data to const WString SavePath = GetPath(PATH_DESKTOP) + "/Sketchfab"; // Licenses we want to include std::set<std::string> Licenses = { "CC0 Public Domain", "Free Standard", "CC Attribution", "CC Attribution-ShareAlike", "CC Attribution-NoDerivs" }; int main(int argc, const char* argv[]) { // You could get settings from command line arguments if you want //auto settings = ParseCommandLine(argc, argv); const int MinLikes = 0;// no minimum const int MaxVertices = 0;// zero to disable const String Author;// specify a user to get files from const String Category;// specify one category String url = "https://api.sketchfab.com/v3/models?downloadable=true&sort_by=-viewCount"; if (MinLikes > 0) url += "&liked_by=" + String(MinLikes); if (MaxVertices > 0) url += "&max_vertex_count=" + String(MaxVertices); if (not Author.empty()) url += "&user=" + Author; if (not Category.empty()) url += "&categories=" + Category;// Example: "weapons-military" CreateDir(SavePath, true); // This allows you to pick up where you left off if the process is stopped for any reason int page = 0; String RequestName = "Request"; RequestName += "_" + String(MinLikes); RequestName += "_" + String(MaxVertices); RequestName += "_" + String(Author); RequestName += "_" + String(Category); CreateDir(SavePath + "/" + RequestName); CreateDir(SavePath + "/" + RequestName + "/metadata"); WString pagefile = SavePath + "/" + RequestName + "/pages.txt"; auto stream = OpenFile(pagefile); if (stream) { stream->Seek(0); while (not stream->Eof()) { url = stream->ReadLine(); ++page; } } else { stream = WriteFile(pagefile); } while (true) { ++page; Print("Page " + String(page)); // Docs: https://docs.sketchfab.com/data-api/v3/index.html#!/models/get_v3_models String s = FetchUrl(url); auto t = LoadTable(s); // Save the JSON data if you want to get a look at it //SaveTable(t, SavePath + "/" + String(page) + ".json"); // Save the metadata for each result if (t["results"].is_array()) { std::string uid, license; int count = t["results"].size(); for (int n = 0; n < count; ++n) { if (int(t["results"][n]["archives"]["glb"]["textureCount"]) == 0) continue;// skip untextured models license = t["results"][n]["license"]["label"]; if (not Licenses.empty() and Licenses.find(license) == Licenses.end()) continue;// skip unsupported licenses uid = t["results"][n]["uid"]; WString filepath = SavePath + "/" + RequestName + "/metadata/" + uid + ".json"; if (FileType(filepath) == 0) { SaveTable(t["results"][n], filepath); } } } else { if (t["detail"].is_string()) { stream->Close(); String s = "Error: " + std::string(t["detail"]); Print(s); Notify(s, "SketchFab API", true); return 1; } } if (not t["next"].is_string()) break; url = t["next"]; stream->WriteLine(url); stream->Flush(); } return 0; }
  5. There is a channel packer tool that allows you to load an opacity map and save it into the alpha channel of a color texture. Is that what you are looking for?
  6. Thanks for the report! AMD driver 24.7.1 is very reliable and good. Unfortunately, recent driver updates introduced a lot of new problems with Ultra and other applications. The issue has been reported to AMD. More information can be found here: https://www.ultraengine.com/community/forum/120-bug-reports/
  7. 0.9.8 Quad brush faces will now build using specified subdivision even when edge size equals zero. Added default edge size setting in options. Selecting a material in the asset browser when the paint tool is active will make the paint tool use that material. Paint panel preview now correctly shows material thumbnail. Fixed the environment probe selection problem, and got rid of the sprite that was hiding inside the sphere indicator.
  8. This is occurring because at the point you are calling FlushEvents(), the windows events have not been received by the engine yet, and are still stuck in the OS event system. I am adding code that will check the OS and clear all waiting events from the system. I am also adding an error that will occur if FlushEvents() is called inside an event callback, since this would modify the event loop as it is being iterated through. Also note that you should check the event source on key and mouse events, since widgets will sometimes emit events like this: case EVENT_KEYDOWN: if (ev.source == window) { Print("Key Down: " + String(ev.data)); currentUI->ProcessEvent(ev); }
  9. Also reported here: https://community.amd.com/t5/pc-drivers-software/opengl-bindless-texture-crash-in-driver-24-10-1/m-p/719662#M198972 I find their forum structure incredibly confusing and I don't know where I am supposed to report bugs.
  10. Okay, this was just caused because I changed the interface to display centimeters and needed to update one place where the value is set...
  11. 0.9.8 Reverted the entity selection behavior in editor, which re-introduces the problem with environment probes, but allows me to take another try at fixing this...
  12. Steam build of 0.9.8d is available now.
  13. I am probably leaning towards making an RPG for the next example game. It seems like the combat and animation are probably the most important factors there, and again, it comes back to having appropriate character models:
  14. 0.9.8d Shaders are updated. Shader families now list a variation for each number of materials in use (1-4) for optimal performance. Vastly improved performance of material painted rendering. Only PBR shader family supports mult-material at this time. Fixed bug that caused probe selection area to be too big. It's available on the standalone build right now. I am having trouble connecting to Steam for some reason, will try again later...
  15. Ideally, we want it to reload automatically, but that functionality might not be working correctly yet.
  16. Josh

    Smarter Tessellation

    This shows tessellation only being used on a painted area, with no subdivision in the areas where the base material does not need it.
  17. Ultra can export a glTF file with this extension.
  18. The readings I am taking here are at 1280x720 resolution with 200% scaling, so the pixel pipeline is 4x more expensive to render, BTW. It seems to be as I feared. The multi-material code always incurs a significant cost, even when only one material is in use. The solution is to define a separate version of the fragment shader for each number of materials that is active. That way the shader will only be compiled with the number of materials that will be used, and you won't be paying for extra materials you aren't using.
  19. Glad to hear that works for you. I will keep this "unsolved" until AMD puts out a new driver.
×
×
  • Create New...