-
Notifications
You must be signed in to change notification settings - Fork 985
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
How to load uv for a decoded draco obj model #103
Comments
UVs can be decoded as shown in the example in As for loading materials and textures, you still need to send them separately as they are not included in the .drc file. If you are using three.js you can still parse the material directly using for example their MTLLoader that is going to create THREE.js material for you (with texture). |
We have tried the above mentioned solution by following codes(partial). It turns out the model can be loaded correctly but the uv still remains missing. On the otherhand, when we use non-converted obj model with mtlloader, it works fine. function loadOneModel() {
|
Sorry for the late response. Can you send me the .drc model with the source .obj (+ the material and texture)? I should be able to help more when I have the input data. |
Hi, Ondrej,
I shall show my gratitude first for your response although you define it as
a late response which is in fact nothing to a hungery guy seeking for
answer. The attached document is the material you requested. Hope it does
not bring you any inconvenience in term of your time. Look forward to have
your late response again. :)
2017-04-21 13:49 GMT+08:00 Ondrej Stava <notifications@github.com>:
… Sorry for the late response. Can you send me the .drc model with the
source .obj (+ the material and texture)? I should be able to help more
when I have the input data.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#103 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AacGfNHxPTnVpzUyymWYaQcgAPknXRuOks5ryEN6gaJpZM4NABsf>
.
|
@jungleowl It seems that the attached document didn't make it all the way here. Or at least I can't see it. Github isn't really good with file attachments so you may need to upload it to some file sharing website and provide a link to the file. |
Hi, Ondrej,
Pls try to use this link which direct to the google cloud where I uploaded
the required document. Thanks a lot!
https://storage.googleapis.com/jungleowl-try/drcToGoogleDraco.zip
2017-04-22 5:36 GMT+08:00 Ondrej Stava <notifications@github.com>:
… @jungleowl <https://github.com/jungleowl> It seems that the attached
document didn't make it all the way here. Or at least I can't see it.
Github isn't really good with file attachments so you may need to upload it
to some file sharing website and provide a link to the file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AacGfH6Z5TMG7L9LY05uSWWymA9bK1SGks5rySFHgaJpZM4NABsf>
.
|
Thanks! I was able to download and test the files and all seemed to work ok for me. The code I used to load material is here:
If it still doesn't work for you, please share your code where you assign the material to the decoded geometry. |
Hi, Ondrej, var onProgress = function(xhr){
|
@jungleowl I see one problem in the snipped you posted:
it should be
|
@ondys Hi, Ondrej, thanks for your reply. The caught problem has been corrected. But ,eventually, We discovered the true problem might not come from the uv applying step, instead, it came from the model loading part. The code below is that we used to load the draco compressed obj model, in fact, the model never been decompressed and rendered correctly since we could not see it in the screen. Tried to solve the problem but due to limitation on the programming, we failed once again.
**********UV APPLYING PART |
Hi, Ondrej, |
Can you send me data for this atmo_fighter example? I really wish I could help more but I still don't see any problem loading a material file using the example you send me via email (except the line but other than that, I was able to load the texture with the data you sent me earlier (i.e. after I replaced atmo_fighter with Tile_+000_+003 model) |
Hi, Ondrej, |
I would just like to clarify that main purpose of Draco is to speed-up streaming and to decrease storage requirements for meshes and point clouds. In the current version, we don't provide any tools that would allow you to reduce system resource consumption after the models are decompressed. We may add some features in future that may reduce memory consumption even for decompressed models, but it would most likely not really solve your problems anyway. For your case, I would suggest looking at compressed texture formats (e.g. DXT1) + alternatively using lower resolution textures and meshes (LOD scheme). Also, in case you don't need to display all models at the same time, you should consider adding caching where not all models are loaded into the system memory all the time. |
Ondrej, Yes, you are ABSOLUTELY right, I was misunderstanding the purpose of Draco. Now, with Draco, our project is going much better than before. I'd like to show my appreciation to you and all other engineers who work on Draco and hope more and more good utilities emerge in the coming future. |
I also encountered the above problem and did not load the mtl material file. |
In future it would be better to open a new issue for this, but for now keep it here. I'll investigate and let you know when I have an update. Thanks for the report! |
@1Idontknow can you please post your code for loading materials + draco file? |
@jungleowl I tried the attached model on both Win64 build and Linux build and in both cases it was compressed without issues (and decoded model looked same as the input). Can you give us more details about your configuration? (e.g. encoding options, OS, etc..). Thanks |
Hi, Ondys, |
thanks. Did the model come with a .mtl file? If so, can you post it as well? The model loading pipeline works slightly differently when a .mtl file is present and I would like to check whether that could be the problem. |
Hi, Ondys, To not interfere with ongoing topic, I'd like make a new question herebelow. |
It is certainly possible (and in fact easier) to load the texture and assign it to Draco model without loading the .mtl file. This is not really related to Draco, but more to THREE.js where you can simply add the loaded texture to your Material.. for example like this:
|
Hi, Ondys, yes, it works. In our scenario, the non-texture properties are all omitted. Thanks a lot! |
@jungleowl I still wasn't able to reproduce the issue. So far I have tried it on a linux machine only. I'll try it again on a Windows machine later today |
@jungleowl I was still unable to reproduce the issue even on a Windows machine. Since you mentioned that it happens to all models in a given batch, maybe it's a problem with a path to the batch? If you try to add a model that you know that works to the problematic batch, does it fail there as well? |
@ondys Sorry for the late reply. The compression procedure worked with new draco version after we compiled the source code of new version. |
@jungleowl What were the issues that you encountered when generating .js on Windows? Our instructions should be mostly platform independent. |
@ondys The issues gone while we deployed the virtual Linux machine and moved all compiling works on it. Thanks a lot for your concerns, and we hope we can keep reporting the issues occurred later on if any. |
@ondys I come again to have your support. |
A little more comments I think I should add. |
@jungleowl If you do that without Draco, do you still have the same memory problems? As far as I know, Draco doesn't leak memory in our THREE.js loader (assuming you are using the one we provided, if you use your custom one, make sure you call destroy(...) on every object that you created in Draco module). |
@ondys , yes, you are right, draco just manages to control the memory very well, the leak was not caused due to draco. We have found our bug and cleared it already. |
@ondys , Hi, buddy, again I come for support. |
@jungleowl Does it work when the texture is excluded completely? I'm just trying to figure out whether this is a problem with Draco or not. Unfortunately I'm not that familiar with iOS development so I cannot give any specific examples in that regard. |
We haven't try load the model without texture since we already encounter the same problem when resizing the texture. We went to the other way to slice the models to pieces, in the case, the total size of the models increased but with less chances of crashing when loading smaller pieces. But there is a very interesting issue happened when we did this. |
@jungleowl One thing that may cause this weird memory consumption is that Draco decoder is going to require much more internal memory to decode a single large mesh vs multiple small meshes. On the other hand, when the decoder is destroyed the memory consumption should be about the same (or larger for the sliced meshes). |
I'm running into the very same issue (#364). It would be much appreciated if we have some working example of loading a |
Hi, I am doing a project to use draco to compress my obj model. Compression is successful but I don't have any idea about how to load uv for the model when decoding the drc file while using the draco_mesh_decoder.js since the .mtl and corresponding jpg file are not covered by the draco compression process.
Could you please share me some example code or some links to introduce the solutions, thanks a lot!
PS: I am using three.js as the basic frame.
The text was updated successfully, but these errors were encountered: