How-To Texture Wavefront (.obj) Models for OpenGL | C++ | learnopengl.com | Assimp | Blender 2.8
HTML-код
- Опубликовано: 5 сен 2024
- Please leave your feedback or questions in the comments!
References -
blender: www.blender.org/
learnopengl: learnopengl.com/
assimp: www.assimp.org/
Find me, support me:
Stream: / overridetheprogram
Patreon: / codetechtuts
One time donations: www.paypal.com...
Shop via my Amazon Affiliates Link: amzn.to/3bVQ9X0
Business inquiries: codetechtuts@gmail.com
Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.
You can actually set "Path Mode" to "copy" in the export dialog. Blender then copies all textures to the same folder as the .obj file and uses relative paths in the .stl file. This is exactly the behaviour needed for the model loader described in the learn OpenGL tutorials.
You saved my life on this one, everyone seems so confused in the comments of that learnopengl part and for good reason. I really couldn't figure out myself too but now I can load a fully textured car. :)
Great, great video. I'm excited to use this material. subscribing!
Welcome aboard!
By the way, you can't see the mouse in the video, would be helpful if your screen recorder also got your mouse movement!
Great tutorial! Thank you
Thanks, I was able to load my low poly world but it's all grey (a bit shiny). I am going to look into this next. Did you ever do the animation video you spoke of at the end of this video?
When I do this the textures come out all wrong. Their coordinates are wrong, and the specular map is enitirely fucked up. Not sure what I'm doing wrong.
Hi, interesting video but I still cant export models. i tried several models I downloaded using sketchfab's blender plugin and the material path in the file i edit point to blender's temp dir instead of the export directory. Anyone had this error?
but what should we do in case there is no
texture ?
What I did inside the fragment shader, I defined a Material structure with the following members: diffuse0, diffuse1, diffuse2, diffuse3, specular0, specular1, specular2, specular3, numOfDiffuse, numOfSpecular. The last two tell me exactly how many diffuse or specular maps I have set from the Mesh::Draw(). For example if numOfDiffuse = 2, then diffuse0, diffuse1 are the set diffuse uniforms (I always set them in order from 0 - 3, the same for speculars). If numOfDiffuse = 0, I know I don't have set any diffuse maps, so I'm using a grey color for the fragments output. In the model loading processMesh() method, if there are no textures at all, just pass an empty std::vector into the Mesh constructor, and inside your Mesh::Draw() if this vector is empty, just set the uniforms numOfDiffuse = 0 and numOfSpecular = 0 and leave the diffuse and specular maps unset.
I'm followng a similar thing but my textures are all over the place. They are not mapped properly. I have the exact OBJ export properties too.
One thing I do when it doesn't seem to be loading correctly is check it in another engine like unity, unreal, or godot and see if it loads correctly there. If it does, it might be your import code or shaders or something rather than the model. Good luck!
Thanks a lot. If i duplicate this object in blender in the world coordinate, do this generate a mchildren[] node with mMeshes[] and mTransformation[] ? Model class from learnopengl seems not supporting mTransformation?
Yes, that is one of things that hung me for a while. The loader from learnopengl is very basic and doesn't do many things that will be needed later, like animations and probably that duplicate feature.
how can i use wavefront
I am following learnopengl too but it takes forever to load model it don't even load program freezes
debug builds of assimp are significantly slower than release builds, are you sure that if you wait long enough it will not load?
@@nspattak1it was not a build issue i got what was wrong ,i was loading all textures of the model even if it was loaded previously that was slowing the program.
So of course... the circle is now to the left of it.... jesus.
The lack of a cursor makes this hard to follow at some points.
i have trouble with import model with this file and about assimp:: importer.h
The quality of this video is just bad. Trying to see where your mouse cursor is clicking in Blender is really hurting my eyes.