-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add textures to renderer #10
Conversation
@@ -60,7 +60,7 @@ class Model | |||
void | |||
recursiveTextureLoad(const struct aiScene *sc, const struct aiNode* nd); | |||
void | |||
recursive_render(const struct aiScene *sc, const struct aiNode* nd) const; | |||
recursive_render(const struct aiScene *sc, const struct aiNode* nd, const int j) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cv qualifiers for integral types are useless in definition. Please remove the const (for integral types, it's only useful for definitions, not declarations).
@vrabaud done ! |
That actually would not work. texturesAndPaths that stacks all the textures of all the meshes of all the nodes is an array and that's probably a bad design. Please convert it to a |
@vrabaud, there is a typo in your last post and I am not sure exactly what unique key you would like me to use. Let me know. I will make the change sometime next Monday once we agree on an appropriate structure. |
That could work but aiGetMaterialTexture is heavy to call. All you have when you need to get a mesh is its aiNode and its index. |
Perfect. This does make more sense now. |
@vrabaud That should be it. |
@@ -199,10 +199,11 @@ Model::recursive_render(const struct aiScene *sc, const aiNode* nd) const | |||
// draw all meshes assigned to this node | |||
for (; n < nd->mNumMeshes; ++n) | |||
{ | |||
glEnable(GL_TEXTURE_2D); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice addition.
thx. Just fix the minor things, squash your commits and pus -f. Thx. |
95a5c4d
to
1d57951
Compare
Commits squashed and forced pushed! There is still some work to do to enable the use of textures for the linemod process. @vrabaud Do you have any idea on which part of the code the problem could come from? |
@vrabaud so what about this PR? Eventhough there is still work to do on the linemod package I think that this is necessary for texture rendering. |
@JimmyDaSilva I tested the suggested modifications on the attached 2 files in the hopes of using my beautiful model for training.
The response was:
Please forgive me if I made a mistake testing this or used an unsupported file, but this change does not work how I expected it to. |
@linknum23 I actually never tested with .dae files, only .obj files. |
@JimmyDaSilva being in the textures folder fixed it. Now I have pretty colors :) Thanks for the help! |
Hey I don't know how I didn't notice this before but all of the textures look mirrored. Is anyone experiencing the same thing? It looks like the textured coke can is mirrored as well ( need higher resolution image to verfiy...). |
Hello, |
@xMutzelx Linemod as it is implemented in OpenCV or PCL does differentiate the colors. Let me know if you get the textures to work. |
so, should I merge this PR ? |
I haven't worked on this for months... but I think you should, along with #13 |
Yes please do, along when the #13 as suggested. |
Does the texture be used now? I achieved the same result just like those two pictures posted by JimmyDaSilva, training in the data folder worked. And I also found some difference between |
This PR is just the changes discussed on wg-perception/linemod#10 and #8
The following images show that the renderer now does show the textures on the renderer.
Though I guess that either the training or the detection doesn't really use texture properly because I can't see a difference between my three items (coke can, nestea can, mug)
@nlyubova: that would be my starting point if you want to try linemod with a textured model