SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 That's okay, I thought I'd just make you aware of it at least. Thanks. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 I know why this is happening. 🤡 The engine uses the depth buffer for 2D ordering, so it does not have to draw 2D objects in order. This is one of the reasons it is so fast. When the GUI generates sprites for all the interface elements, it starts by positioning them at the far depth range, and moves each one a little closer to the camera, to make it appear on top of the last one. It seems that at about 2000 the Z-position increments pass the near depth range, so the sprites after that are no longer visible to the camera. Not a bug, just the way it is designed. Normal sprites that you position yourself will not do this. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 Ah okay all good then Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Yep, I confirmed this. I could make the increment smaller. I don't know what the lower limit is before Z-fighting will start happening. But I don't think this is really a problem, in any case. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 13 hours ago, SpiderPig said: No mouse events for tabber or button (disable the panel creating in the loop to see this) Press Space a few times - Red panel clipping exceeds parents size by 1 pixel in both x & y Sprite remains in renderlayer 0. Solved! Powers of 2 required. Only downside to not use the enum Tab page and button left border clipped off Drawing widgets stops at the 2,000 mark? Excessive I know but is this some sort of limit or bug? I'm not going to worry about small cosmetic issues right now. There are a few places where a line is off by one pixel, or something like that. This should be resolved, but I would like to focus on anything more important right now. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 Yeah I don't think it'll be a problem either. I'll start testing things a developer then and only report the bigger problems Link to comment Share on other sites More sharing options...
SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 Is there way we can draw a line between two points on screen with varying thickness? I think I can make a thin sprite and rotate it towards a point, but have you made a better way? Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 No, in the GUI system everything is right angles. I thought about adding lines and Bezier curves in a future update. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 2 hours ago, SpiderPig said: Got it to work, Thankyou. Should the sprites follow the same position system as the GUI? I mean 0,0 at the top left? No, because your sprites are in 3D space. Just calculate the Y position like this: y = framebuffer->size.y - y I suppose the fact there is no 2D drawing is an argument for camera project/unproject to pre-flip the Y coordinate. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 34 minutes ago, Josh said: No, in the GUI system everything is right angles. I thought about adding lines and Bezier curves in a future update. I manged to use a sprite for now. Looks okay but maybe AnitAliasing will help with this when it's ready. Can I simply change the depth position of a sprite so it can appear behind a widget? In this case the line sprite needs to go behind the "head" panel. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Yeah, just nudge it forward away from the camera: line->SetPosition(line->position + Vec3(0,0,0.1)); 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Update Fixed serious bug in thread manager that could have affected all system, physics, rendering, culling, etc. The wrong mutex was being locked when commands were added to the thread command buffer. 😱 Number of maximum GUI widgets visible will probably be about 20,000 now 2 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 45 minutes ago, SpiderPig said: I manged to use a sprite for now. Looks okay but maybe AnitAliasing will help with this when it's ready. Can I simply change the depth position of a sprite so it can appear behind a widget? In this case the line sprite needs to go behind the "head" panel. You could also just create a model with a mesh that uses lines: https://www.ultraengine.com/learn/CreateMesh 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted January 2, 2023 Share Posted January 2, 2023 @Josh Made a pull request to the preprocessor to allow user flexibility. It'll still work the same way without any additional parameters set. Decided to contribute it as this will probably change as the engine matures. Added arguments to define search paths and file names. Added timestamps to be written to generated files. Added timestamp to the start of the application. The preprocessor will force a rebuild if the application is newer than the component system files. Fixed GetComponent() not having a return value in all cases. Added Help screen. when -help is set. Set the project to be built as a console application. Fixed size conversion warnings. Fixed a typo. 1 Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 How does it know what the application name is? You mean the executable file, right? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted January 2, 2023 Share Posted January 2, 2023 Yes. If the preprocessor is ever newer than an existing project, it'll force a rebuild. //Compare it with the time of this application. //If this application is newer, force a rebuild. if (FileTime(WString(argv[0])) > headertime && !rebuild) { Print("Regenerating Component System files as the pre-processor has been updated since last generation."); rebuild = true; } Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Oooooh okay. Good idea. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted January 2, 2023 Share Posted January 2, 2023 Should note that my EOF fix doesn't work when compiling with the engine. But it's super simple to fix with a comment. // 230102 - reep: Make me compatible with the engine. #if !defined (Eof) #define Eof EOF #endif The engine defines _ULTRA_APPKIT so there isn't a safe way to find a difference between the two. However, it's more ideal to keep compile this with UAK as it's a shorter build time. Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted January 2, 2023 Share Posted January 2, 2023 Forgot to add a semicolon on line 669. My example never called the function so it was missed. Also, I guess LoadJSON got thanos snapped from the API... Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Oh yeah, I changed those to LoadJson, SaveJson, ParseJson... 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 Okay, your changes to the preprocessor are live now. I also removed UPX compression from the VS template. I don't recommend using this because it can sometimes trigger antivirus programs. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted January 2, 2023 Share Posted January 2, 2023 I've made a new pull request to fix the missing semicolon and changed my note about the Eof define., Not sure if you corrected it already on your end or not. 1 Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
SpiderPig Posted January 2, 2023 Share Posted January 2, 2023 7 hours ago, Josh said: Update Fixed serious bug in thread manager that could have affected all system, physics, rendering, culling, etc. The wrong mutex was being locked when commands were added to the thread command buffer. 😱 Number of maximum GUI widgets visible will probably be about 20,000 now So this was the cause of the random crashes? Link to comment Share on other sites More sharing options...
Josh Posted January 2, 2023 Author Share Posted January 2, 2023 8 minutes ago, SpiderPig said: So this was the cause of the random crashes? Yes. Your app should be fine now. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts