Roland Posted June 9, 2012 Share Posted June 9, 2012 Josh. In LE3D, will it be possible to load models etc in a background thread. In Leadwerks3D we have the LoadXXXX command which loads an assets and attaches it for rendering in the same command. That makes background loading hard to do. Would it be separated so LoadXXXX just loaded the asset, and we then could Add the asset when its time for rendering, background loading would be easy in LE2. How will that be in LE3D? Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted June 9, 2012 Share Posted June 9, 2012 The only reason why multithreading does not work in LE2, is that when loading a model, the texture size is reported as 0 in the threads. This is probably caused by the way how LE2 uses OpenGL. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 But say I want to load a completely new scene while still at end of current one. The LoadModel commands will automatically show the new models as they are loaded, right? I don't want to show or use them until the current scene is ended, and then quickly be able to switch to next one without loading delay. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted June 9, 2012 Share Posted June 9, 2012 LoadModel works only in the main thread, because of the texture 0 size problem. Everything else in LE2 is multi-threading capable, just not LoadModel. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 Lets hope that will be fixed in LE3D then or even better ... in LE2 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted June 9, 2012 Share Posted June 9, 2012 I don't think it can be fixed in LE2, because it uses garbage collection, that is the core reason for all problems with LE2. Slow CPU performance (GPU performance is OK), Windows Desktop disappearing (the classical BlitzMax bug, which some have, some don't (or who don't use their computer much, but still have it)). The sole fact that LE3D is written in C++ will solve a lot of problems, because C++ just works. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 Ok.. Garbage then Well as long as its fixed in LE3D I'm happy Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted June 9, 2012 Share Posted June 9, 2012 Leadwerks3D makes extensive use of multithreading in its internal routines. Great care has been taken so that physics and pathfinding will constantly run in a background thread, only syncing up with the main thread when tasks are complete. However, you can't just call engine commands from different threads arbitrarily. Quote 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...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 Sounds good to me, Josh. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted June 9, 2012 Share Posted June 9, 2012 Like Windows Phone apps, everything should be done in multi-threading manner. Sorry for giving Microsoft a credit, but they accidentally do sometimes something right. I actually noticed this with Fastnet yesterday, the whole idea of of WinSock is to drive the whole init+run+term chain into a seperate process. Kinda wierd, but it makes sense, and it requires also less programming, because you just multi-thread the whole program and don't have to take care of any threads or conditions. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 I like that you are giving Microsoft a credit Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Naughty Alien Posted June 10, 2012 Share Posted June 10, 2012 ..actually, you can do it in LE2, by loading your assets and Hidding them, soon as they are loaded, just before render/flip calls..it works for me.. Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted June 10, 2012 Share Posted June 10, 2012 ..actually, you can do it in LE2, by loading your assets and Hidding them, soon as they are loaded, just before render/flip calls..it works for me.. That is what I was doing. I loaded all the models I needed for a level and hid the ones that were not necessary. Kinda like a content factory. However, doesn't that take up a lot of memory space to store all the data for all the models? I like that you are giving Microsoft a credit Same I actually like Microsoft.. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 10, 2012 Share Posted June 10, 2012 Same I actually like Microsoft.. Same here ... and apparently the chip on the shoulder of Linux fanboys is manufactured by AMD and not Intel ... fits the stereotype I guess Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Roland Posted June 10, 2012 Author Share Posted June 10, 2012 ..actually, you can do it in LE2, by loading your assets and Hidding them, soon as they are loaded, just before render/flip calls..it works for me.. Yeah that should work. But how do you know when you are just before 'flip' when you are in a 'loading thread'. Maybe some semaphore or other thing.. hmm.. yeah that would probably work. Great idea. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Naughty Alien Posted June 10, 2012 Share Posted June 10, 2012 @Roland Yes, of course..what I said is just a simplified way of process itself, but basically, there is a loading manager what will make sure that all assets are loaded before render/flip call is executed..it does work fine so far, even more elegant solution will be levels set in such way that initial camera cant see them, regardless of rendering/flip execution or not.. Quote Link to comment Share on other sites More sharing options...
Roland Posted June 10, 2012 Author Share Posted June 10, 2012 Thanks for the extended answer on this Naughty Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted June 10, 2012 Share Posted June 10, 2012 You can potentially get random crashes doing that. There are a great many ways it can mess things up. For example, if the model surfaces get initialized while the engine is in the middle of rendering something, or if the global models list gets modified while being read, etc. it will cause unpredictable behavior and nondeterminstic results. Quote 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...
Roland Posted June 10, 2012 Author Share Posted June 10, 2012 You can potentially get random crashes doing that. There are a great many ways it can mess things up. For example, if the model surfaces get initialized while the engine is in the middle of rendering something, or if the global models list gets modified while being read, etc. it will cause unpredictable behavior and nondeterminstic results. Yes. That was what I was afraid of. Well. No big deal. I will manage it some other way. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Benton Posted June 13, 2012 Share Posted June 13, 2012 I shall manage this by using Leadwerks3D Quote Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.