Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is node instancing valid? #276

Closed
vinjn opened this issue May 27, 2014 · 8 comments
Closed

Is node instancing valid? #276

vinjn opened this issue May 27, 2014 · 8 comments

Comments

@vinjn
Copy link
Contributor

vinjn commented May 27, 2014

I got some collda files that heavily use <library_nodes >and <instance_geometry>.

The converted gltf looks like this, unimportant details are skipped:

"nodes": {
    // reusable node
    "base0": {
        "children": [],
        "meshes": [
            "mesh0"
        ],
    },
    "base1": {
        "children": [],
        "meshes": [
            "mesh1"
        ],
    },

    // nodes that use base0
    "node_101": {
        "children": [
            "base0"
        ],
    },
    "node_101": {
        "children": [
            "base0"
        ],
    },

    // nodes that use base1
    "node_10": {
        "children": [
            "base1"
        ],
    },
    "node_100": {
        "children": [
            "base1"
        ],
    },
}

However, neither Three.js nor Cesium can correctly render the mesh, only base0 and base1 are visible.

Is this the limitation of gltf format or bug of Three.js and Cesium?

@fabrobinet
Copy link
Contributor

I don't think this:

 "node_101": {
        "children": [
            "base0"
        ],
    },
    "node_101": {
        "children": [
            "base0"
        ],
    },

can happen.

Anyhow, i'd like to have a look, can you send me a test model ? thank you.

@vinjn
Copy link
Contributor Author

vinjn commented May 27, 2014

Dae file uploaded as https://cloud.githubusercontent.com/assets/558657/3093329/694702ee-e5b1-11e3-9c48-138430dd89c6.jpg
You can download the jpg, and rename the extension to 7z and extract it.

Thank you!

@fabrobinet
Copy link
Contributor

Ok thanks, I just checked, I am not exactly sure about the problem you are reporting.

  1. First thing is it seems you use an older version of the converter (I don't find same ids for mesh).
  2. I suspect many leaves should have in the DAE the double_sided extra flag to get expected rendering.

That's the rendering I get because of 2. foliage does not appear as dense as it could be (but overall looks correct ?):
screen shot 2014-05-27 at 8 47 00 am

You can see that if I rotate the camera I can see the faces discarded by culling:
screen shot 2014-05-27 at 8 54 08 am

You can verify with this viewer:
https://github.com/fabrobinet/glTF-webgl-viewer/blob/master/README.md

However, neither Three.js nor Cesium can correctly render the mesh, only base0 and base1 are visible.
Is this the limitation of gltf format or bug of Three.js and Cesium?

We need first to figure out if something is wrong in the generated file. Also, is there a a viewer that can display just the DAE file as you expect ? just to be sure the COLLADA is matches your expectations.

@fabrobinet
Copy link
Contributor

Well, I feel like I have some documentation to add in the viewer just pointed out above :)...
So if you'd like to visualize your model, just convert it , move it in the /model/folder and add an entry in stage.js, here: https://github.com/fabrobinet/glTF-webgl-viewer/blob/master/ui/stage.reel/stage.js#L92-L96

@vinjn
Copy link
Contributor Author

vinjn commented May 27, 2014

Thanks @fabrobinet, your result looks pretty good.
It could be the problem of old converter tool.
I will try new converter and your viewer now.

@vinjn
Copy link
Contributor Author

vinjn commented May 27, 2014

All right, I can have the correct result from glTF-webgl-viewer.

However, the result rendered by Three.js is wrong.

image

It seems it's the bug of Cesium and Three.js, they happen to lack the support for instanced node.
I will report bugs in their issues.

@vinjn vinjn closed this as completed May 27, 2014
@fabrobinet
Copy link
Contributor

Please check this out @tparisi @pjcozzi thanks.

@pjcozzi
Copy link
Member

pjcozzi commented May 27, 2014

@vinjn you are welcome to submit an issue to Cesium and we'll look at it eventually. Please provide the test model and a link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants