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

some collada files are displayed incorrectly in webgl #16

Closed
bcohen opened this issue Aug 14, 2013 · 8 comments
Closed

some collada files are displayed incorrectly in webgl #16

bcohen opened this issue Aug 14, 2013 · 8 comments
Labels

Comments

@bcohen
Copy link

bcohen commented Aug 14, 2013

First of all, thank you very much for this tool. The robotics community really appreciates it :).

I came across this collada parser as part of the http://robotwebtools.org/ project and most of the time, it works great. However we do see sometimes that, some collada files get loaded incorrectly. By that I mean, some textures aren't loaded at all, some textures look bad and some of the "parts" of the drawing are missing altogether. Some other folks that use the robot web tools have experienced the same thing....in general, the community has been using this tool to see which dae files load well and which ones don't - and then chooses meshes for their projects this way.

We were wondering whether anyone knows why this happens? Maybe there is some way we can preprocess our meshes to prevent it? Is this related to how some submeshes are described in the file? Any advice or clues would be appreciated.

For example, we downloaded and modified this kitchen from 3dwarehouse (we removed the ceiling and some other parts). The modified version is hosted here in dae, stl, skp format.

The kitchen:
kitchen

The kitchen visualized with webgl (same result would be found using this tool):
kitchen_in_webgl

(Thank you very much in advance)

@crobi
Copy link
Contributor

crobi commented Aug 14, 2013

Parts that are missing alltogether: your file uses <library_nodes>, which is not supported yet by the loader - I didn't expect this feature to be used. I'll open a separate issue for this (#17).

Materials looking "bad": I'll need to investigate this in detail. Do you have specific examples (in the file you posted)? One thing I see is the floor texture is rendered with "clamp" instead of "repeat" texture addressing mode. Not sure if this a problem with the COLLADA format, the sketchup exporter, your specific file, or this loader.
Possibly related: mrdoob/three.js#2569

@bcohen
Copy link
Author

bcohen commented Aug 14, 2013

Thanks for the quick response.

Ahhh OK. I just grepped for "library_nodes" in my folder of meshes and almost all of the dae files that I pulled off of 3dwarehouse came up. This makes sense now. Thanks.

Materials looking bad: Yea, I was referring to the floor texture. I'll ask my teammates for more examples.

@bcohen
Copy link
Author

bcohen commented Aug 15, 2013

My team is curious if there are plans to work on issue #17 in the near future? I'm asking because we are wondering if we should look into ways of getting around this by either searching for another parser, converting dae files with library_nodes to ones without or figuring out how to add the functionality to this parser.

Thanks again!

@crobi
Copy link
Contributor

crobi commented Aug 16, 2013

I had a quick look at how difficult #17 would be to implement. It's doable, but a proper implementation would take more time than I have in the near future. Please see the corresponding issue for details.

As much as I'd love to see this loader being used, here's a couple of thoughts:

  • COLLADA is a very complex format for content exchange between modelling tools and generally not suitable as a runtime format.
  • In addition to its complexity, the COLLADA specification is not very precise and every modelling tool uses a different subset of the format. I don't expect it will work flawlessly across different tools any time soon.
  • While this loader seems to work better than the built-in three.js COLLADA loader, there will always be bugs and features not implemented, and I won't always be able to provide proffessional support.
  • COLLADA as a runtime format is therefore good for rapid prototyping, but if you use it for assets of a commercial grade application, I would consider using the native three.js json format (exporters for blender and 3ds max available) or glTF.
  • These runtime formats are usually slightly smaller and load orders of magnitude faster than COLLADA.
  • The disadvantage of these runtime formats is that they add additional tools to your toolchain, and thus more work for your users.

@crobi
Copy link
Contributor

crobi commented Aug 16, 2013

About the texture repeat problem: WebGL only supports the repeat wrapping mode for power-of-two textures. Your ground texture is 401x401. You'll need to resize it to 256x256 or 512x512 to get the desired effect. Three.js silently overrides the wrapping mode to clamp to edge if the texture is not power-of-two.

@bcohen
Copy link
Author

bcohen commented Aug 19, 2013

Thanks a lot for the quick and detailed response.

couple of thoughts:
We are sad to hear it but understand completely. I don't have an opinion on the COLLADA file format being used at runtime....on my project, we just load them in at startup and that's it for the session....it may not be optimal but it's been working. Sadly, our community relies heavily on COLLADA files so I think we will need to find another solution. If you hear of anything, please post it here :). We will look into the json format or gitf formats out there too.

texture repeat problem:
Thanks a lot for the insight. This is a very doable fix for us.

thanks again. 👍

@bcohen
Copy link
Author

bcohen commented Oct 29, 2013

For people who are using collada files created in SketchUp:

If you want to get around this issue ("library nodes" are ignored), then just ungroup all of the components of your mesh before exporting to Collada. From recent experience, it seems like if all of the components are completely ungrouped - then no "library nodes" are created. Highlight everything, click ungroup and export to collada.....now it should the file should be loaded correctly by this loader.

@crobi
Copy link
Contributor

crobi commented Jul 8, 2014

The soruce of the problems described here is discussed in #17

@crobi crobi closed this as completed Jul 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants