I’m considering buying Unity, but would like to know something very important for future works:
Do you think there is a way (as a C++ Plugin in Pro version I suppose) to able Unity to support a “paged textures” feature on a sphere for example ? What I want is something like http://moquette.hybird.org/trac
(watch the video!)
This enables very hi-def planet rendering, but without elevation LOD of course…
I’m using such features with 3d engines like Ogre or Openscenegraph, and would like to swith to Unity, but I don’t know the “limits” of C++ plugins in Unity.
This feature could be the 1st step of hidef terrain rendering, and my final goal could be to adapt “GPU Geometry Clipmap” (the best terrain algorithm for me) to Unity :lol:
I maybe need to be a little bit precise about my questions :
I only would like to know ff writting plugins in C++ and call them with C# script will able me to access internal scenegraph to manage my own LOD for geometry and my own texture loading scheme (with cache for example) to draw my big-textured planet ?
I’m going to check the OpenGL texture plugin example provided on the website, but I don’t know for the moment what C++ plugins permit regarding the scenegraph and what they don’t permit…
Something that is not clear at all for me regarding Unity 3D engine architecture :
Is it possible to load textures in a separate thread and assign it on the fly to geometry in use ?
In my planet example problem, you need to assign to sphere portions a texture which is viewer distance dependent, and texture database is so huge that you absolutly can’t have it in memory, so you need to load it on the fly from HD in a thread and put it on the mesh…
That’s why I was talking about c++ plugin, because I don’t know if you can use threads in script, and even if c++ threads are supported by Unity Engine when playing with textures for example.
If someone has ever do something similar or if the development team can answer me about threads possibilities, it’s very important for me in a lot of projects.
The WWW class class can retrieve a URL (which can be a file) at runtime. The class has a property that lets you access the loaded data as a Texture2D, which you can then apply to an object in the game. This doesn’t run in a separate thread as such, but it can certainly run asynchronously in a coroutine - there is an example of this on the WWW doc page.
Andeee : Ok so for the moment you agree that I can’t do this in separate thread. Asynchronous is beautiful but will generate application freeze when loading assets, no ?
Lazalong : So we are in the same state Good news in the roadmap indeed ! Seems that we will able to load textures and more in background threads, which is not a little new feature !
Can Someone in the Dev Team confirm such a feature in 1.6 ?
There’s no freezing - the download happens in the background. You can either poll the isDone variable or yield the WWW object (execution will resume after the download is complete). In neither case is the game paused while the download takes place - see the doc page for more details.
Thanks andeeee for your reactivity, but when we wrote our message, we where under Unity 2.5, ok ? What I cannot understand is that one of the new features of the 2.6 version is the (wonderful) ability to load assets in the background (in Pro only if I’m right), so where is the new thing if you can do it using WWW in 2.5 as you said ?
Sorry for all these questions, but this feature is Sooo important for real-data based terrain rendering that I want to dig it a lot :roll: