[Fiware-miwi] xml3d.js question: knowing when a material is ready?

Felix Klein lachsen at cg.uni-saarland.de
Wed Nov 6 10:01:17 CET 2013


Hi Toni,

XML3D works already in a way, that meshes are displayed before all
connected textures are fully loaded.
If the textures are not available, the shader code is adapted to work
without textures. It is possible to create custom shaders that work
elegantly with and without textures.

What XML3D does not do is schedule the loading of resources in any specific
way. Currently it works like this: When a <mesh> or <shader> is hooked into
the document, the whole connected <data> subtree is loaded with all
textures. You can influence the loading by only hooking in content that
should be loaded.

It is currently not possible to query whether all textures inside a
<data>,<shader> or <mesh> element have been loaded, but we have this state
internally and it would be easy to implement such an interface.

Since incremental loading seems more and more important for 3D
applications, I actually propose a system to handle this more generically
in XML3D.
I have a system in mind that is flexible and can be controlled from the
application (which I think is important).
The basic idea is, that <data> elements (or any other DataContaine) can be
annotated with a loadPriority attribute. The higher the value, the less
important all resources inside the <data> element are. We can first use
this attributes to determine the ordner in which to load resources.
On top of that, we can annotate <mesh> and <shaders> element with the
"loadUntil" attribute (or something like that). If this attribute is
specified, only conent with a loadPriority smaller or equal to "loadUntil"
will be loaded.

Such a system can be used by your application in the following way:
- You'd annotate all connected textures with a loadPriority of, say, "5".
- Mesh and shader element close by get annotated with a "loadUntil" value
of 5, such that everything including textures is loaded
- Mesh and shader element far away get annotated with a "loadUntil" value
lower than 5. In that case, texture won't get loaded

This is just an idea, though.

Bye

Felix



On Wed, Nov 6, 2013 at 8:26 AM, Toni Alatalo <toni at playsign.net> wrote:

> Hi, another requirement for / question about xml3d.js from the scene
> scalability work:
>
> Question:
> Could we already know somehow in xml3d.js when a material, that uses
> textures, is ready for display?
>
> Case:
> We have proceeded to levels-of-detail work in the scalability effort for
> the city model and have now first tested the idea that more remote city
> blocks are loaded without (full) textures first, and then if the view gets
> nearer, the material with the high detail textures is switched to display.
> It is good to do that only when the material is fully ready for display,
> i.e. the texture(s) for it are loaded from the net and all the way to the
> graphics memory etc.
>
> Three.js does not readily provide that so in the current implementation we
> need to track the loading ourselves — WebRocket does something similar,
> probably close to how it works in native Tundra where the Asset manager
> tracks the loading of dependencies and informs about completions.
>
> So this is to a) inform about yet another requirement discovered in this
> work and b) ask about the current state of that in xml3d.js.
>
> Cheers,
> ~Toni
> _______________________________________________
> Fiware-miwi mailing list
> Fiware-miwi at lists.fi-ware.eu
> https://lists.fi-ware.eu/listinfo/fiware-miwi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-miwi/attachments/20131106/829791f4/attachment.html>


More information about the Fiware-miwi mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy