For those who are having crashes with loading new models. Main reason might be the file "Model.cpp" on line 193. Loader is trying to load "byteOffset" value from the .gltf file which may not be present. Fix this by setting the default value of the returned JSON value. Change the line to "unsigned int byteOffset = bufferView.value("byteOffset", 0);" You may still have some crashes with some models, textures being messed up or meshes not in the right position. In this case you should really understand how this simple loader gets its data from the gltf files.
7:47 I think this may be the reason for you having to negate the rotation matrix and the UVs. The order in which parameters of a function are read is unspecified in c++. MSVC reads them from right to left, so in the constructor of glm::vec3, i++ in the z value gets incremented first, then y, and then x. The x and z values are thus interchanged, but the y remains unaffected. It's probably better to use a more traditional for loop here.
I found a little flaw ! This model loader works perfectly in Debug Mode, however , it does not load anything in Releae Mode. It is a vicious issue lol. the error is due to release mode optimizing the for loops. The compiler will try and run for loops in parallel meaning the code in model.cpp from lines 305 onwards will not run as expected (the groupFloatsVec functions). You will need to change them to be for (int i = 0; i < floatVec.size(); i+=3) (replace 3 with 2 for vec2 and 4 for vec4 etc) then you need to do glm::vec3(floatVec[i+2], floatVec[i+1], floatVec[i] for a vec3 for example) etc in the for loop. You really should precise it cause Release Mode is neccesary for anyone that wants to export their projects as .exe files. Hope that helps !
@@VictorGordan Dude great video. I followed part through and managed to get this to build, run, output the JSON data in the output and still no models shows... Guess it's time to watch the tutorial from the start but if you could make a updated version of this tutorial that would be AWESOME. Thanks again dude, great vid
Learning OpenGL is a very rewarding thing, just watched the Tutorial from beginning up to this one on a crash course. P.S. The programming code kinda reminds me of ZScript from Doom Source Ports and Mods but more simple.
Scroll model has holes. To draw them correctly, fragment shader should discard pixel where: "if(texcolor.a < 0.5) discard;". Alternative solution is to use alpha blending (requires sorting geometry or Order Independent Transparency method, so it's much harder), but in that model discarding is enough.
if someone has problem with rendering in release mode, or rotated bunny model (other models probably too): Solution 1: change C++ version to 17 Solution 2: change every expression like "uint8_t bytes[] = { data[i++], data[i++], data[i++], data[i++]};" to "uint8_t bytes[] = { data[i], data[i+1], data[i+2], data[i+3]}; i+=4;". At least in Model.cpp Problem was with undefined order of computing arguments in older version of C++. C++17 finally specifies the order.
A troubleshooting tip. I wasn't able to get a Model to load for quite awhile and after stepping through with the Debugger. I noticed that my scale was either set to some extremely low value (e-6) or exactly 0. I found out that in my Mesh.h, in my void Draw() that I was initializing the scale values to be glm::vec3(0.0f, 0.0f, 0.0f) by accident. While I'm not sure if its because the sword.gltf did not have scale values to over-ride the 0s and I'm missing something else. But I hope this helps anyone who reads this and is stuck!
I've been watching your tutorials and really appreciate them. However, I have a question about glTF and the JSON description. After a quick search, it seems that glTF can import objects using JSON files. If I need to import an asset (.uasset) created in unrealengine or a model from another program, do I need to convert the model to a JSON file so I can import it into glTF? Does this require some knowledge of JSON to import, and is that why you added the explanation in the tutorial?
this video helped me a lot to put objects and scenarios in my project, but I'm having problems making the animation system, I already made one in assimp so I know the base
Hello Victor, thanks for this tutorial. The 3D model is loading but i still get an error. If I compile the program, it is bringing me to this line in json.h: JSON_THROW(type_error::create(302, concat("type must be number, but is ", j.type_name()), &j)); I copied your code in github and paste it everywhere, hoping it vanish. Do you have any idea? Still thank you for your tutorials!
@@freemotion21probably because it doesn’t really teach, so knowledge isn’t really gained because you are essentially just copy and pasting code while scrambling to try to do it as fast as possible because he only goes over topics for a split second in the video
@@kingofspades9720 this sort of tutorial is meant for people that are already experienced with c++. he isn't really teaching c++ or anything, mainly hes just explaining the opengl implementation in c++ while giving you an example. this is more for people making their own engine that want to understand opengl more. your correct about the headache inducing editing though, he should really pause for a second every edit just to allow you to keep up.
@@Combinehuntsmanunit I’m not amazing at programming or anything, but I have a masters in computer software(at the end of this term), and this still was a super annoying video to watch to learn OpenGL, it wasn’t the complexity of having to basically learn C++ and OpenGL, this video still has a horrible teaching style even if you have the C++ experience
Great tutorial as always, Victor! Dictionaries is one of the reasons why I love Python, so it's awesome to see the C++ (JSON) variant to this in your tutorial.
Great lesson! No problems with simple models, really. But with complex gltf i cannot understand, whether supported several meshes in one model or not. I have a car model with 80 objects in it (with simple single materials for every mesh), but Model.cpp draws only first mesh. So car body looks great but has no wheels, decals, and so on. PS. used with MinGW.
The index files I come across have 4 vertex/texture/normal groups per line instead of 3. Is that forth one used with 2 of the first three to make another triangle with a shared side?
Look at the camera tutorial to see how to handel inputs, and look at the going 3d tutorial to see an example of using rotation matrices to rotate models ;)
@@colbymartin2499 Yeah I did in the end. For a rotating cylinder, I wrote it something like this: - Set a starting speed of 0.0f to a speed variable - Create a key listener - When the key is pressed, set speed to whatever - Set the ObjectModel = glm::rotate(ObjectModel, glm::radians(the speed variable), glm::vec3(axis to rotate on)) - Activate shader - Update matrices
Very good tutorials, congrats! You seem to have corrected the negative sign in front of the rotation matrix 12:18 , in the tutorial 14, you don't have it anymore. Could you tell us how you fixed it? Thanks for everything!
Hmmm, yeah tbh I'm not sure what's going on exactly 🤔 I messed up smth small at some point somewhere, but at this point I really don't feel like finding the bug... don't even have the time for it
Hi 👋, I need some help, I imported models from your repo, everything works fine but textures aren’t being mapped properly, textures are messed up (I even tried the source code)
Can you describe in what way they are messed up? My guess would be they are turned by 90 degrees in one direction. If you look in the vertex shader, you'll see I multiply the texture coordinates with a mat2. For me rotating them makes them look normal, but perhaps your system is different. So just delete that mat2 and see if that fixes it. ;) Good luck!
What 3D modeling program are you using to generate your "scene.gltf" file? I exported one from Blender and it doesn't have that "uri" field. I also tried exporting my gltf using the three.js online editor and it did have the "uri" field that time, but it was populated with a long string of data starting with "data:application/" and then followed by a bunch of binary data instead of "scene.bin" like your file. EDIT: Nevermind! I found out how to export the bin with Blender. Thanks for the tutorial!
You can also get gltf models from the website I mentioned in the video. I think they're owned by Epic now, so they probably have even more free stuff than before haha
@@skibidisigma122 First select "File > Export > glTF". Then in the window that comes up after, select "glTF Seperate (.gltf + .bin)" from the format dropdown menu.
This has been very helpful though admittedly most of the JSON explanations went over my head lol. Thank you for this series. And any clue how to render with a single or a couple draw calls for these models? Calling the Mesh::Draw function for every mesh seems inefficient
Thank you! Check out tutorial number 21 (Instancing) to see how to use less draw calls for identical models. As for models that differ, the only way I am aware of is to combine their vertex data into a single VBO and so you only need one draw call. But that's a bit more advanced...
if you want, you can use his totorial with something called assimp. i used this because it lets me import obj and fbx file formats thats what blender 2.79 can export. i now have a gameobject class that stores meshes and executes a alternative mesh.draw so i have them all liked to one gameobject. this also lets me do stuff like rotating the whole object at its axis. i also use it because it imports bones too so im working on getting animation to work. if you want to try it dont get the files from their site since it looks sketchy. safer to get it from jpres's library. he uses directx11 but it works since we just want the uv coords, vecticies and indicies.
Thank you for your video. It works fine for me for the models in your repo. But it didn't work for any other model I downloaded from sketchfab. I understand that you intentionally wrote a simple importer for this tutorial that will work only for basic models. Is there an official importer somewhere that works for all models? (in gltf site for example?) I looked everywhere in the internet and didn't find any. I find it very strange that the developers of gltf didn't supply any importer for opengl (c++) since that's the goal of gltf isn't it? how can people use it and render models without an importer?
I think there are some gltf importers, but not any official ones. If u want a quick library to use, go with assimp, especially since there are some tutorials on it out there ;)
If there's a library for it then you 100% use it, apart from practice, why bother wasting time understanding a big data type such as gltf if the creators/passionate programmer already did and made some easy importer for it. We have tinygltf for example, it already parses the data into nice lists that you can pick from, without you needing to understand all the fuckfest of a tree they created
Hello Victor, I am having a problem in this video related to textures, when I use one of my models the textures doesnt load and it only appears the model in black, I know its been 3 years but, Can you help me?
I did evrything exactly as you but i'm having 4 warnings and the glwindow is closing after a second , warings are C26800 use of a moved from object "("")" in json.h file on line 4009.
@Victor Gordan Very nice series, has motivated me to return to OpenGL. I am having a problem with this tutorial tho: after calling the draw function I don't see the model (only the background) and I don't get any errors. Any idea why this might be happening?
@@VictorGordan Managed to track down the error. I am getting a GL_INVALID_OPERATION from the VAO.Bind() in the Mesh::Draw() call. This just got me even more confused. Any ideas?
@@VictorGordan I figured it out. It's because I am a dumbass! For some reason I decided to call glDeleteVertexArrays in the destructor of the VAO, which was called when we are adding temporary objects to the vector, so by the time I was drawing the model I didn't have a VAO.
I have followed the tutorial exactly and I managed to load the bunny model in , but it is upside down. Also, how can I load a model that I downloaded online that only has a .gltf file and nothing else? The way your code works, I also need basecolor and metallic elements.
well, this is weird all the models work textures and all. but when I make a random cube with a texture it just loads black yet in any other program, it loads in normally. is there a converter that would work or anything that could help?
If you made a cube in Blender, then you probably exported the model in a compact format, while the importer in the tutorials requires a gltf file + a binary file + texture files. Also make sure the textures have names that the importer supports. Changing just the names of the textures does not work, you also have to change the names of the textures inside the gltf file ;)
Hi thanks for the videos they all have been extremely helpful, I was wondering how could I move a model up/down/left/right. I loaded in two models but they seem to be quite close to each other. Can you help me?
Move them using translations matrices! You just have to slightly modify the model class to accept translation matrices from outside the importer like it is now
Just personal opinion but I think this tutorial kinda goes a little bit overboard with .gltf file. Something easy like .obj file could have been better. That being said, great work my guy.
Very fair point. I was actually thinking about using .obj due to its simplicity, but decided against it due to the *hopefully* bright future of glTF. That being said, if I ever decide to redo this series and make it better, I will probably use .obj since it would be a lot more noob friendly haha
How can i know xyz coordinates of mesh triangle (or point) selected with mouse on imported mesh? Does opengl provide method to tell which vertex was clicked? Separate question is which object was clicked.
OpenGL doesn't provide anything like that by default, you have to implement it yourself. Here's something to get you started on it: community.khronos.org/t/selecting-vertices/44202
Hey I used to be able to load models easily following ur tuts, but now every time I load something new, json.h throws an exception for type_error saying “type must be number”. I can still load previous models but I can’t load any new models at all even though windows model loader opens them just fine. Do u know what’s going on with that exception? Cheers
@@VictorGordan ahh now i see why, btw any plans on doing assimp? I know there are other resources out there but ur style of teaching is what makes it great 😌
Same here. Provided models work fine but any new .gltf file throws an error "nlohmann::detail::type_error at memory location 0x0000001AB82FA388" at the "type must be number" line. Props for making custom loader but would be awesome tutorial if it would show what to do next to get it working again or point to the right direction. I believe pros definitely know what to do but majority of the viewers here are beginners.
Hi! Loving your tutorials so far! One question: I got the code working with the provided models in Debug, but not in Release. Do you know why that could be? Thanks!
@@VictorGordan Thanks for the quick help! Unfortunately, it looks like I did do that. I even tried resetting the dependencies for All Configurations and All Platforms... Any idea what I should do?
@@thomasspalter5958 Wait, by "Release" did you actually mean the executable? Because if you try to run it from outside VS, then you need to copy all the resource files (shaders, textures, meshes) into the same folder as the executable ;)
@@VictorGordan I don't think so, as I'm still running the program from VS. If this helps, the problem I'm running into happens before I press Local Windows Debugger, where next to it I can choose Debug or Release. In Debug, the Model shows, and there's a short period where the program's screen is white before displaying the model with my ClearColor. In Release, the ClearColor shows up immediately, but there is no model. Thanks for your help!
The only other explanation I can think of is that one of the libraries you might be debug only, not release as well. Other than that I really have no idea, sorry :/
I was following up all the series to this video, but after this one, I just don't get where the lighting is coming from You seem to have removed the lighShader in the main.cpp file, so how does it work? Or is the light supposed to be included in the gltf file? When I import the bunny, I just get a get bunny without light... I tried the sword model and I don't see anything. The scroll model is soo big... even when zooming out, I just see a part of it I probably did something wrong, if you could let me know what this is that would be awesome! Thanks
The lightShader has nothing to do with lighting. All that the shader was for, was to display the little cube as a representation of a light source. The actual light "comes" from the lightColor uniform and the lightPos uniform, and then the way that light "behaves" is all coded in the default.frag shader. But keep in mind that just because your models are black, it does not mean that there is something wrong with the lighting. There might be something wrong with the texture importing, or something else. Can't really tell you much without seeing the code. I suggest just making sure your code is the same as the source code. Also, I suggest re-watching the lighting video since you don't seem to fully comprehend how the light works.
@@VictorGordan Thank you for this reply and your comments, I'll have a look again at the code, probably some bug in my code as I rewrote while I was following the videos! I didn't understand everything 100% indeed, sometimes your video go very fast... but I definitively learned a lot. Thanks again for your amazing video series
Yeah, they do go fast, but if you don't understand something, just go back a few seconds and listen to it again :) The way I meant the videos to be watched it by looking at the theory, seeing some code, pausing, writing it, unpausing, listen to some more theory. It's not really meant to take you the length of the video. Glad you enjoy the series though! :)
@@VictorGordan Yeah sure, I understand and it's really well done! I found my problem and it was very stupid... just forgot to change the light type in the fragment shader... it was set to spotlight so I didn't see anything. Now it works ! Thanks again
trans, rot , scale are all abstracted to mesh class while model class only 2 parameters in its Draw() function , its not possible to transform from main.cpp file 😪
@@VictorGordan Thanks! Do you plan on making a video on collision detection? What I'm interested in is creating walls for my environment that the camera can't go past.
.obj should be much easiee than .gltf, but also much more limited in terms of the stuff it can hold. I suggest looking for some tutorials (there should be some for .obj) or just looking at how the file is structured. Keep in mind .obj is essentially a text file, so you'll have to read and interpret the data yourself as far as I'm aware.
Hey could anyone help me I keep getting an error which says Unhandled exception thrown: read access violation. **_Parent_proxy** was 0xFFFFFFFFFFFFFFF7. could anyone help?
It's basically impossible to debug that without seeing the code. I suggest first trying to find the line where the error happens, and then posting a question on stack overflow :)
problem here, important sword model and the vertices / shape of the sword is fine but it seems the textures arent been set because the sword just has red, green, blue lines
@@VictorGordan found the problem, i changed the desired channels in stbi_load from 0 to stbi_rgb_alpha because there was an exception error when running the pyramid program. changed it back and it work fine
Hello Victor! I have some problems with the model loading... I get "unhandled exception" when i try to run my code. It happens specifically at the data=getData() function in model.cpp. The error says "int at memory location 0x00". Any ideas on this?
@@VictorGordan Hello Victor. I'm trying to use assimp loading from learnopengl tutorial in conjunction with this tutorial. Do you have any plans on making an assimp tutorial for this series?
idk if im dumb or what or is it supposed to happen but im getting like 5k errors at 1:19 including E0135 namespace "nlohmann" has no member "json" using json = nlohmann::json; the second json is underlined with red but yours isnt, is that supposed to happen? i made the json.h file at libraries/include/json with the json stuff in it
ok so apparently these two files are different? the one i copied: raw.githubusercontent.com/nlohmann/json/develop/include/nlohmann/json.hpp and your json.h: raw.githubusercontent.com/VictorGordan/opengl-tutorials/main/UA-camOpenGL%2013%20-%20Model%20Loading/Libraries/include/json/json.h yours is working fine but the one i got gave all the errors
i found the problem - i clicked on the releases json file which was released in 2020 august while the correct one in the actual develop branch was the most up to date one :D
where do you put the models? Do you just take the models folder and copy and paste it directly into your solution? I dont think you specify this and you go way too fast at the end
hey when switching between debug and release i dont see the models in release but theyre fine in debug, was there anything else i needed to edit other than vc++ directories - include and library directories and linker - input - additional dependencies? i cant figure out where the problem is at :D
That's why you should always select "All Configurations" :p haha Check the following: Configuration Properties -> General Configuration Properties -> VC++ Directories C/C++ -> General Linker -> Input Though these seem to be the same as the ones you've listed.... I might be missing something as well though. Also keep in mind that perhaps one of your libraries only works for debugging and not for release. Some libraries are split like that. Good luck finding the problem ;)
@@VictorGordan i'm also getting a defaultlib 'MSVCRTD' conflicts with use of other libs error and PDB 'glfw3.pdb' was not found at x64/release when on release, could potentially be a library issue?
@@Greenlaser To be honest I don't really know what the problem might be. Never happened to me (I usually just mess up the linking or something like that, which does not seem to be the case here). Sorry... :/
Hello, I have a very urgent matter if anyone in the comments can help me. Is there a tutorial, based on the model class in this tutorial that shows us how to move the model once we loaded it? I have loaded in a submarine model, but I want to make it so that when I press the WASD keys the submarine moves. how do I do that?
longer than usual? this is still way shorter than those other 30 mins to an hour of OpenGL tutorials! often, they would talk about the life problem! But you, you're just speeding man! also, the Triangle one is 15 minutes and this is 14 minutes and 49 seconds🙃
Well as it says, you have an error somewhere inside your Vertex Shader most likely. That's also why nothing appears, because if there is an error in the vertex shader, it discards all the geometry. If there is an error in the fragment shader, is keeps the geometry but makes it all black. Hope that helps :)
You move it using translation matrices, look at the camera and going 3D tutorials for more insight into that. You can blur a scene using framebuffers, I also have a tutorial on that ;)
If you are having issues and ur thing says something about auto texture recognition, comment out the else statement in texture.cpp and the throw std invalid thingy
Well I can't help you with that little information... All I can say is check the code is the same (many people say the code is identical, and then they discover it's not)
Just try redownloading the models and everything until they work with the windows model loader. Or sometimes itll not work with the windows model loader but sometimes load. It's just really finnicky
I have simillar problem. I can load all model but their are not rotated in right way (where their should be vertically oriented they are horizontally) and my texture look like they are loading wrong. They are there but not the right way.
@@VictorGordan I just want to implement a method called "rotate" because i have to rotate my model. I would not want to create a new model for every rotation i want 😅 Is there not somewhere the data? You talked about we need to assign the transfomation i thought it is i there?
Severity Code Description Project File Line Suppression State Error C2783 'nlohmann::json_abi_v3_11_3::basic_json::operator ValueType(void) const': could not deduce template argument for 'ValueType' Project1 C:\Users\mansha\Documents\Project1\Model.cpp 124 can someone please explain why showing this error?
It's a long time ago that I wrote the code, but if I remember correctly it either has a default name such as "diffuse0.png", or there is a variable of the name somewhere in the code...
@@VictorGordan i looked up for everything i am trying to fix this issue 2 days ago the sword mesh is being huge and there are no texture just black color
This exact implementation? No, not at all. It's not good. But generally speaking if you make a custom glTF importer, then yes, it can be faster than assimp :)
@@VictorGordan I actually found something really cool called Assimp, which effectively parses all the data from most 3D model formats into a specific structure with all the data in it you'd need for vertices, indices, etc. It's got a C interface, so I'm gonna try implementing it first thing tomorrow.
Yeah, and I think that there being a shit ton of data formats for meshes is really annoying and I hope that glTF will be the future of mesh data formats
So this dont work for me at all - to the extent that I removed my project and just copied the source. I get this Cannot open include file: 'std_image.h': No such file or directory OpenGLGame C:\Programming\OpenGLGame\OpenGLGame\stb.cpp I dont know why stb has stopped working :/
Hi ! Great video as always ! I tried to export a textured cube made with Blender in the correct format (separated GLTF) but it seems only the shape is rendered, and not the texture : I get a black cube as a result... any hint ?
@@VictorGordan I tried, but it still doesn't work (also the texture in the sword model doesn't have "diffuse" in its name) :( Maybe I should use another editor ?
i'm not getting any erorrs, but it just doesn't work, the model isn't showing up, trust me, i copied almost every file now from your github, because it didn't work but still, it doesn't work, i'll try tomorrow, let's not ruin this day
ok, my computer has problems... it gets bluescreens and stuff, but my guess is that the problem doesn't lie in my code, it maybe lies in the model itself
gltf is fucking terrible, i tried importing alot of gltf models but they just dont work so i made my own obj and ply parsers instead of this disfunctional format which was 20 times easier and 100% more working
For those who are having crashes with loading new models.
Main reason might be the file "Model.cpp" on line 193. Loader is trying to load "byteOffset" value from the .gltf file which may not be present.
Fix this by setting the default value of the returned JSON value. Change the line to "unsigned int byteOffset = bufferView.value("byteOffset", 0);"
You may still have some crashes with some models, textures being messed up or meshes not in the right position. In this case you should really understand how this simple loader gets its data from the gltf files.
thx a lot, it worked! ;)
you are truly a hero
love u bro you made my day
underrated comment
Thanks a lot sir! Can you please explain what the issue was initially?
7:47 I think this may be the reason for you having to negate the rotation matrix and the UVs. The order in which parameters of a function are read is unspecified in c++. MSVC reads them from right to left, so in the constructor of glm::vec3, i++ in the z value gets incremented first, then y, and then x. The x and z values are thus interchanged, but the y remains unaffected. It's probably better to use a more traditional for loop here.
Huh... I had no idea about that 🤔 thank you! I should def study up on C++ more... 😅
I found a little flaw ! This model loader works perfectly in Debug Mode, however , it does not load anything in Releae Mode. It is a vicious issue lol. the error is due to release mode optimizing the for loops. The compiler will try and run for loops in parallel meaning the code in model.cpp from lines 305 onwards will not run as expected (the groupFloatsVec functions). You will need to change them to be for (int i = 0; i < floatVec.size(); i+=3) (replace 3 with 2 for vec2 and 4 for vec4 etc) then you need to do glm::vec3(floatVec[i+2], floatVec[i+1], floatVec[i] for a vec3 for example) etc in the for loop. You really should precise it cause Release Mode is neccesary for anyone that wants to export their projects as .exe files. Hope that helps !
Sadly the model loader has more flaws than just that haha. Not very proud of this video tbh :(
But even so, I think it might still help some ppl •~•
@@VictorGordan Dude great video. I followed part through and managed to get this to build, run, output the JSON data in the output and still no models shows... Guess it's time to watch the tutorial from the start but if you could make a updated version of this tutorial that would be AWESOME. Thanks again dude, great vid
Thank you so much for the tutorials!! I'm trying to finish a project for college and so far you explained almost everything i have to implement!
You're welcome! :)
Learning OpenGL is a very rewarding thing, just watched the Tutorial from beginning up to this one on a crash course.
P.S. The programming code kinda reminds me of ZScript from Doom Source Ports and Mods but more simple.
Scroll model has holes. To draw them correctly, fragment shader should discard pixel where: "if(texcolor.a < 0.5)
discard;".
Alternative solution is to use alpha blending (requires sorting geometry or Order Independent Transparency method, so it's much harder), but in that model discarding is enough.
Yeah, I'm planning to do a video on transparency soon! :)
if someone has problem with rendering in release mode, or rotated bunny model (other models probably too):
Solution 1: change C++ version to 17
Solution 2: change every expression like "uint8_t bytes[] = { data[i++], data[i++], data[i++], data[i++]};" to "uint8_t bytes[] = { data[i], data[i+1], data[i+2], data[i+3]}; i+=4;". At least in Model.cpp
Problem was with undefined order of computing arguments in older version of C++. C++17 finally specifies the order.
@@ZizuZiomek Thank you for contributing!
A troubleshooting tip.
I wasn't able to get a Model to load for quite awhile and after stepping through with the Debugger. I noticed that my scale was either set to some extremely low value (e-6) or exactly 0.
I found out that in my Mesh.h, in my void Draw() that I was initializing the scale values to be glm::vec3(0.0f, 0.0f, 0.0f) by accident.
While I'm not sure if its because the sword.gltf did not have scale values to over-ride the 0s and I'm missing something else.
But I hope this helps anyone who reads this and is stuck!
actually goated for explaining the format
Nice tutorial, it really helped me.
Waiting for the animation tutorial.
Thank you! ^-^
Don't hold your breath, the animation tutorial is unlikely to come anytime soon...
I've been watching your tutorials and really appreciate them. However, I have a question about glTF and the JSON description.
After a quick search, it seems that glTF can import objects using JSON files.
If I need to import an asset (.uasset) created in unrealengine or a model from another program, do I need to convert the model to a JSON file so I can import it into glTF?
Does this require some knowledge of JSON to import, and is that why you added the explanation in the tutorial?
You need some converter i think khronos linked them in their github page
this video helped me a lot to put objects and scenarios in my project, but I'm having problems making the animation system, I already made one in assimp so I know the base
Hello Victor, thanks for this tutorial. The 3D model is loading but i still get an error. If I compile the program, it is bringing me to this line in json.h:
JSON_THROW(type_error::create(302, concat("type must be number, but is ", j.type_name()), &j));
I copied your code in github and paste it everywhere, hoping it vanish. Do you have any idea? Still thank you for your tutorials!
This is a good example on how this teaching style doesn't work.
Wdym
@@freemotion21probably because it doesn’t really teach, so knowledge isn’t really gained because you are essentially just copy and pasting code while scrambling to try to do it as fast as possible because he only goes over topics for a split second in the video
@@kingofspades9720 this sort of tutorial is meant for people that are already experienced with c++. he isn't really teaching c++ or anything, mainly hes just explaining the opengl implementation in c++ while giving you an example. this is more for people making their own engine that want to understand opengl more. your correct about the headache inducing editing though, he should really pause for a second every edit just to allow you to keep up.
@@Combinehuntsmanunit I’m not amazing at programming or anything, but I have a masters in computer software(at the end of this term), and this still was a super annoying video to watch to learn OpenGL, it wasn’t the complexity of having to basically learn C++ and OpenGL, this video still has a horrible teaching style even if you have the C++ experience
Great tutorial as always, Victor! Dictionaries is one of the reasons why I love Python, so it's awesome to see the C++ (JSON) variant to this in your tutorial.
Great lesson! No problems with simple models, really. But with complex gltf i cannot understand, whether supported several meshes in one model or not. I have a car model with 80 objects in it (with simple single materials for every mesh), but Model.cpp draws only first mesh. So car body looks great but has no wheels, decals, and so on. PS. used with MinGW.
Yeah, this does not work with complex models :(
The index files I come across have 4 vertex/texture/normal groups per line instead of 3. Is that forth one used with 2 of the first three to make another triangle with a shared side?
Great tutorial, as always! How would I go about rotating a model/ changing its position when a key is pressed? Thanks in advance!
Look at the camera tutorial to see how to handel inputs, and look at the going 3d tutorial to see an example of using rotation matrices to rotate models ;)
@gavgonacrt Did you ever end up figuring this out?
@@colbymartin2499 Yeah I did in the end. For a rotating cylinder, I wrote it something like this:
- Set a starting speed of 0.0f to a speed variable
- Create a key listener
- When the key is pressed, set speed to whatever
- Set the ObjectModel = glm::rotate(ObjectModel, glm::radians(the speed variable), glm::vec3(axis to rotate on))
- Activate shader
- Update matrices
Very good tutorials, congrats!
You seem to have corrected the negative sign in front of the rotation matrix 12:18 , in the tutorial 14, you don't have it anymore.
Could you tell us how you fixed it?
Thanks for everything!
I have sadly did not fix it :c
I just removed it cause that's what worked for this particular model...
@@VictorGordan that's weird, all objects you have in your resources are print upside down without it for me (including the ones of the next tutorials)
Hmmm, yeah tbh I'm not sure what's going on exactly 🤔 I messed up smth small at some point somewhere, but at this point I really don't feel like finding the bug... don't even have the time for it
Hi 👋, I need some help, I imported models from your repo, everything works fine but textures aren’t being mapped properly, textures are messed up (I even tried the source code)
Can you describe in what way they are messed up? My guess would be they are turned by 90 degrees in one direction. If you look in the vertex shader, you'll see I multiply the texture coordinates with a mat2. For me rotating them makes them look normal, but perhaps your system is different. So just delete that mat2 and see if that fixes it. ;)
Good luck!
What 3D modeling program are you using to generate your "scene.gltf" file? I exported one from Blender and it doesn't have that "uri" field. I also tried exporting my gltf using the three.js online editor and it did have the "uri" field that time, but it was populated with a long string of data starting with "data:application/" and then followed by a bunch of binary data instead of "scene.bin" like your file.
EDIT: Nevermind! I found out how to export the bin with Blender. Thanks for the tutorial!
You can also get gltf models from the website I mentioned in the video. I think they're owned by Epic now, so they probably have even more free stuff than before haha
@@skibidisigma122 First select "File > Export > glTF". Then in the window that comes up after, select "glTF Seperate (.gltf + .bin)" from the format dropdown menu.
Typing feels so clean, without tabbing every word
This has been very helpful though admittedly most of the JSON explanations went over my head lol.
Thank you for this series. And any clue how to render with a single or a couple draw calls for these models? Calling the Mesh::Draw function for every mesh seems inefficient
Thank you! Check out tutorial number 21 (Instancing) to see how to use less draw calls for identical models. As for models that differ, the only way I am aware of is to combine their vertex data into a single VBO and so you only need one draw call. But that's a bit more advanced...
@@VictorGordan I thought of that. It has been a busy week but I'm finally getting to implement it
pls make a video on rendering .STL's w/ microstl + opengl.
Hey victor, do you have any idea how multiple models could be loaded? I tried but only one mesh displays.
if you want, you can use his totorial with something called assimp. i used this because it lets me import obj and fbx file formats thats what blender 2.79 can export. i now have a gameobject class that stores meshes and executes a alternative mesh.draw so i have them all liked to one gameobject. this also lets me do stuff like rotating the whole object at its axis. i also use it because it imports bones too so im working on getting animation to work. if you want to try it dont get the files from their site since it looks sketchy. safer to get it from jpres's library. he uses directx11 but it works since we just want the uv coords, vecticies and indicies.
Hi, nice tutorials. Why is the default value of bufferViewInd set as 1? If the index is not specified, shouldn't it be 0?
Thx :)
Could you point out where in the video I wrote that? I wrote this a long time ago so I don't remember what that is for 😬
@@VictorGordan Oh sorry about that. It's 5:20
@@randomdudely yeah, I believe you are right, it should be 0...oops
Thx for the catch!
@@VictorGordan no problem. Thank you for this series :)
12:30 why did i put minus sign like you :c? It reversed all of my axes
Thank you for your video. It works fine for me for the models in your repo. But it didn't work for any other model I downloaded from sketchfab. I understand that you intentionally wrote a simple importer for this tutorial that will work only for basic models. Is there an official importer somewhere that works for all models? (in gltf site for example?) I looked everywhere in the internet and didn't find any. I find it very strange that the developers of gltf didn't supply any importer for opengl (c++) since that's the goal of gltf isn't it? how can people use it and render models without an importer?
I think there are some gltf importers, but not any official ones. If u want a quick library to use, go with assimp, especially since there are some tutorials on it out there ;)
It doesnt work because the model is huge and when imported it goes way beyond the camera's vision. Rescale the model in Blender.
In your opinion, could there be any benefits to parsing the gltf files yourself (apart from learning), or is it better to use a library?
99% of the time a library would be better
If there's a library for it then you 100% use it, apart from practice, why bother wasting time understanding a big data type such as gltf if the creators/passionate programmer already did and made some easy importer for it. We have tinygltf for example, it already parses the data into nice lists that you can pick from, without you needing to understand all the fuckfest of a tree they created
Hello Victor, I am having a problem in this video related to textures, when I use one of my models the textures doesnt load and it only appears the model in black, I know its been 3 years but, Can you help me?
I did evrything exactly as you but i'm having 4 warnings and the glwindow is closing after a second , warings are C26800 use of a moved from object "("")" in json.h file on line 4009.
@Victor Gordan Very nice series, has motivated me to return to OpenGL. I am having a problem with this tutorial tho: after calling the draw function I don't see the model (only the background) and I don't get any errors. Any idea why this might be happening?
Most likely a vertex shader bug, or a problem with the model loader
@@VictorGordan Managed to track down the error. I am getting a GL_INVALID_OPERATION from the VAO.Bind() in the Mesh::Draw() call. This just got me even more confused. Any ideas?
That error can be caused by many many things :(
@@VictorGordan I figured it out. It's because I am a dumbass! For some reason I decided to call glDeleteVertexArrays in the destructor of the VAO, which was called when we are adding temporary objects to the vector, so by the time I was drawing the model I didn't have a VAO.
I have followed the tutorial exactly and I managed to load the bunny model in , but it is upside down. Also, how can I load a model that I downloaded online that only has a .gltf file and nothing else? The way your code works, I also need basecolor and metallic elements.
well, this is weird all the models work textures and all. but when I make a random cube with a texture it just loads black yet in any other program, it loads in normally. is there a converter that would work or anything that could help?
If you made a cube in Blender, then you probably exported the model in a compact format, while the importer in the tutorials requires a gltf file + a binary file + texture files.
Also make sure the textures have names that the importer supports. Changing just the names of the textures does not work, you also have to change the names of the textures inside the gltf file ;)
@@VictorGordan thank you turns out the texture name wasn't supported
Hi thanks for the videos they all have been extremely helpful, I was wondering how could I move a model up/down/left/right. I loaded in two models but they seem to be quite close to each other. Can you help me?
Move them using translations matrices! You just have to slightly modify the model class to accept translation matrices from outside the importer like it is now
@@VictorGordan Thank you!! :D
@@VictorGordan May I ask that how to modify the code specifically? I tried. But it still can't move correctly. Could you help me?
@@kyonoaku8478 rewatch the "Going 3D" tutorial from this series, that should hopefully clear it up
@@VictorGordan Thank you! I'll watch it again. This series is awesome. You did a mega job! ❤️
Just personal opinion but I think this tutorial kinda goes a little bit overboard with .gltf file. Something easy like .obj file could have been better. That being said, great work my guy.
Very fair point. I was actually thinking about using .obj due to its simplicity, but decided against it due to the *hopefully* bright future of glTF. That being said, if I ever decide to redo this series and make it better, I will probably use .obj since it would be a lot more noob friendly haha
How can i know xyz coordinates of mesh triangle (or point) selected with mouse on imported mesh? Does opengl provide method to tell which vertex was clicked? Separate question is which object was clicked.
OpenGL doesn't provide anything like that by default, you have to implement it yourself. Here's something to get you started on it: community.khronos.org/t/selecting-vertices/44202
Hey I used to be able to load models easily following ur tuts, but now every time I load something new, json.h throws an exception for type_error saying “type must be number”. I can still load previous models but I can’t load any new models at all even though windows model loader opens them just fine. Do u know what’s going on with that exception? Cheers
The loader is not that good, it probably sees smth it doesn't expect and just throws an error 😅
@@VictorGordan ahh now i see why, btw any plans on doing assimp? I know there are other resources out there but ur style of teaching is what makes it great 😌
No, I won't do assimp, sorry :(
Same here. Provided models work fine but any new .gltf file throws an error "nlohmann::detail::type_error at memory location 0x0000001AB82FA388" at the "type must be number" line.
Props for making custom loader but would be awesome tutorial if it would show what to do next to get it working again or point to the right direction. I believe pros definitely know what to do but majority of the viewers here are beginners.
Hi! Loving your tutorials so far! One question: I got the code working with the provided models in Debug, but not in Release. Do you know why that could be? Thanks!
When you were setting up your project properties you did not select "All Configurations" ;)
@@VictorGordan Thanks for the quick help! Unfortunately, it looks like I did do that. I even tried resetting the dependencies for All Configurations and All Platforms... Any idea what I should do?
@@thomasspalter5958 Wait, by "Release" did you actually mean the executable? Because if you try to run it from outside VS, then you need to copy all the resource files (shaders, textures, meshes) into the same folder as the executable ;)
@@VictorGordan I don't think so, as I'm still running the program from VS. If this helps, the problem I'm running into happens before I press Local Windows Debugger, where next to it I can choose Debug or Release. In Debug, the Model shows, and there's a short period where the program's screen is white before displaying the model with my ClearColor. In Release, the ClearColor shows up immediately, but there is no model. Thanks for your help!
The only other explanation I can think of is that one of the libraries you might be debug only, not release as well. Other than that I really have no idea, sorry :/
Very nice series of tutorials except I didn’t really like the speed of the tutorial, I always had to pause the video or turn the playback speed down.
I was following up all the series to this video, but after this one, I just don't get where the lighting is coming from
You seem to have removed the lighShader in the main.cpp file, so how does it work?
Or is the light supposed to be included in the gltf file?
When I import the bunny, I just get a get bunny without light...
I tried the sword model and I don't see anything.
The scroll model is soo big... even when zooming out, I just see a part of it
I probably did something wrong, if you could let me know what this is that would be awesome!
Thanks
The lightShader has nothing to do with lighting. All that the shader was for, was to display the little cube as a representation of a light source. The actual light "comes" from the lightColor uniform and the lightPos uniform, and then the way that light "behaves" is all coded in the default.frag shader.
But keep in mind that just because your models are black, it does not mean that there is something wrong with the lighting. There might be something wrong with the texture importing, or something else. Can't really tell you much without seeing the code.
I suggest just making sure your code is the same as the source code. Also, I suggest re-watching the lighting video since you don't seem to fully comprehend how the light works.
@@VictorGordan Thank you for this reply and your comments, I'll have a look again at the code, probably some bug in my code as I rewrote while I was following the videos! I didn't understand everything 100% indeed, sometimes your video go very fast... but I definitively learned a lot. Thanks again for your amazing video series
Yeah, they do go fast, but if you don't understand something, just go back a few seconds and listen to it again :)
The way I meant the videos to be watched it by looking at the theory, seeing some code, pausing, writing it, unpausing, listen to some more theory. It's not really meant to take you the length of the video.
Glad you enjoy the series though! :)
@@VictorGordan Yeah sure, I understand and it's really well done!
I found my problem and it was very stupid... just forgot to change the light type in the fragment shader... it was set to spotlight so I didn't see anything. Now it works ! Thanks again
trans, rot , scale are all abstracted to mesh class while model class only 2 parameters in its Draw() function , its not possible to transform from main.cpp file 😪
Bunny model is small, scroll model is so huge that is clips out when I try to zoom back far enough to see all of it.
Yeah, they are of different sizes haha. You can make them bigger or smaller by multiplying their vertex positions by a constant
@@VictorGordan Thanks! Do you plan on making a video on collision detection? What I'm interested in is creating walls for my environment that the camera can't go past.
I might do that at some point, but it's for sure not a priority right now
@@VictorGordan Thanks for the info, keep it up, these tutorials are the best I've seen so far on OpenGL.
If you wanted to load lets say 3 models, what would you have to do with reference to your code?
You'd just have to load three models and draw them. That's all there is to it 😅
@@VictorGordan oh ok lol
Hey man. If I wanted to have an .obj importer instead of gltf what would I have to do ?
Thanks.
.obj should be much easiee than .gltf, but also much more limited in terms of the stuff it can hold. I suggest looking for some tutorials (there should be some for .obj) or just looking at how the file is structured.
Keep in mind .obj is essentially a text file, so you'll have to read and interpret the data yourself as far as I'm aware.
@@VictorGordan Thanks man. Will look for it. Hope it works.
In the constructor for the Model class I get a "nlohmann::detail::parse_error " when trying to parse any of the models :( any idea?
Nu clue honestly. Smth to do with the json library. Try googling it
Hey could anyone help me I keep getting an error which says Unhandled exception thrown: read access violation.
**_Parent_proxy** was 0xFFFFFFFFFFFFFFF7. could anyone help?
It's basically impossible to debug that without seeing the code. I suggest first trying to find the line where the error happens, and then posting a question on stack overflow :)
problem here, important sword model and the vertices / shape of the sword is fine but it seems the textures arent been set because the sword just has red, green, blue lines
That should be an easy fix. You probably imported the texture as GL_RGB instead of GL_RGBA or viceversa ;)
@@VictorGordan found the problem, i changed the desired channels in stbi_load from 0 to stbi_rgb_alpha because there was an exception error when running the pyramid program. changed it back and it work fine
yo how do i change the scale, position, and rotation of a model. cant seem to figure it out looking at the code.
Check tutorial 7. It's about how 3D projection works. That should answer your question if I remember the contents of the video correctly
Hello Victor! I have some problems with the model loading... I get "unhandled exception" when i try to run my code. It happens specifically at the data=getData() function in model.cpp. The error says "int at memory location 0x00".
Any ideas on this?
No clue, it could be anything really :(
@@VictorGordan Hello Victor. I'm trying to use assimp loading from learnopengl tutorial in conjunction with this tutorial. Do you have any plans on making an assimp tutorial for this series?
No, I don't plan on making an AssImp tutorial :/
idk if im dumb or what or is it supposed to happen but im getting like 5k errors at 1:19 including E0135 namespace "nlohmann" has no member "json"
using json = nlohmann::json;
the second json is underlined with red but yours isnt, is that supposed to happen? i made the json.h file at libraries/include/json with the json stuff in it
ok so apparently these two files are different?
the one i copied: raw.githubusercontent.com/nlohmann/json/develop/include/nlohmann/json.hpp
and your json.h:
raw.githubusercontent.com/VictorGordan/opengl-tutorials/main/UA-camOpenGL%2013%20-%20Model%20Loading/Libraries/include/json/json.h
yours is working fine but the one i got gave all the errors
i found the problem - i clicked on the releases json file which was released in 2020 august while the correct one in the actual develop branch was the most up to date one :D
👌🏻
where do you put the models? Do you just take the models folder and copy and paste it directly into your solution? I dont think you specify this and you go way too fast at the end
It doesn't really matter where the models are as long as your filepath to the models is correct
hey when switching between debug and release i dont see the models in release but theyre fine in debug, was there anything else i needed to edit other than vc++ directories - include and library directories and linker - input - additional dependencies? i cant figure out where the problem is at :D
That's why you should always select "All Configurations" :p haha
Check the following:
Configuration Properties -> General
Configuration Properties -> VC++ Directories
C/C++ -> General
Linker -> Input
Though these seem to be the same as the ones you've listed.... I might be missing something as well though. Also keep in mind that perhaps one of your libraries only works for debugging and not for release. Some libraries are split like that.
Good luck finding the problem ;)
@@VictorGordan i'm also getting a defaultlib 'MSVCRTD' conflicts with use of other libs error and PDB 'glfw3.pdb' was not found at x64/release when on release, could potentially be a library issue?
@@Greenlaser To be honest I don't really know what the problem might be. Never happened to me (I usually just mess up the linking or something like that, which does not seem to be the case here).
Sorry... :/
@@VictorGordan i believe the best solution then is to redo the project from the beginning cuz i cant find the problem :D
lol, that's one way of going about it I suppose haha
Hello, I have a very urgent matter if anyone in the comments can help me. Is there a tutorial, based on the model class in this tutorial that shows us how to move the model once we loaded it? I have loaded in a submarine model, but I want to make it so that when I press the WASD keys the submarine moves. how do I do that?
👍
👌
longer than usual? this is still way shorter than those other 30 mins to an hour of OpenGL tutorials! often, they would talk about the life problem! But you, you're just speeding man! also, the Triangle one is 15 minutes and this is 14 minutes and 49 seconds🙃
I also find it annoying when they just stop and spend time thinking about something or tell their life story haha
getting this error when loading
SHADER_COMPILATION_ERROR for:VERTEX
the project loads fine but i cant see anything other than the blue color
Well as it says, you have an error somewhere inside your Vertex Shader most likely. That's also why nothing appears, because if there is an error in the vertex shader, it discards all the geometry. If there is an error in the fragment shader, is keeps the geometry but makes it all black.
Hope that helps :)
@@VictorGordan yes i found differences in both the Model.cpp and default.vert scripts :D
Hi, I have a question. How could i blur a model or move it? Can you help me?
You move it using translation matrices, look at the camera and going 3D tutorials for more insight into that.
You can blur a scene using framebuffers, I also have a tutorial on that ;)
@@VictorGordan Thanks. And how could i disappear half of model or something like that? 😅
Not sure what you mean exactly, but I'm sure there are multiple ways of doing it (stencil buffers come to mind first, which I also have a tutorial on)
Why not use the .obj file format.
Very limited. But yeah, for a series meant for beginners I should have went with .obj
If you are having issues and ur thing says something about auto texture recognition, comment out the else statement in texture.cpp and the throw std invalid thingy
I can only load the stanford rabbit for some reason and I copy and pasted from the source in every file apart from main.cpp. please help.
Well I can't help you with that little information... All I can say is check the code is the same (many people say the code is identical, and then they discover it's not)
@@VictorGordan nvm I got it working it was a problem with the gltf files and the textures for some reason they just refused to load
@@n0o0ot38 hey man having the same problem here, mind telling me how u fixed it?
Just try redownloading the models and everything until they work with the windows model loader. Or sometimes itll not work with the windows model loader but sometimes load. It's just really finnicky
I have simillar problem. I can load all model but their are not rotated in right way (where their should be vertically oriented they are horizontally) and my texture look like they are loading wrong. They are there but not the right way.
Lighting doesn’t work anymore.
Hello i wanted to ask where the matrix is? I mean how can i transform the model? I have just a vector of matricies
Hmmm, I honestly don't remember, it was a long time ago. It's either in the json file, or you can manually send it to the shader using a uniform ;)
@@VictorGordan I just want to implement a method called "rotate" because i have to rotate my model. I would not want to create a new model for every rotation i want 😅 Is there not somewhere the data? You talked about we need to assign the transfomation i thought it is i there?
Then you for sure need to use uniforms ;)
@@VictorGordan Doesnt it reset the uniform after one frame?
Only if you choose to reset it. From what I remember the uniform will keep the value it was last set to
When I try to compile I get LNK2019 error and I can't figure out how to solve it
That's a linking error. There are many possible causes for it, so I can't rly help :/
@@VictorGordan It says the problem is in the Model.obj
I didn't have this error before I included JSON
Then it's a linking error related to JSON. You didn't link it properly
I did it same as it is in the tutorial is there something more I need to do?
You probably missed a small step or something. The way I did it in the tutorial should work
Severity Code Description Project File Line Suppression State
Error C2783 'nlohmann::json_abi_v3_11_3::basic_json::operator ValueType(void) const': could not deduce template argument for 'ValueType' Project1 C:\Users\mansha\Documents\Project1\Model.cpp 124 can someone please explain why showing this error?
how its gonna know what the value of loadedTex/TexName
It's a long time ago that I wrote the code, but if I remember correctly it either has a default name such as "diffuse0.png", or there is a variable of the name somewhere in the code...
@@VictorGordan i looked up for everything i am trying to fix this issue 2 days ago the sword mesh is being huge and there are no texture just black color
@@VictorGordan I checked every .h and every .cpp file that we created this lesson and are the same what you did in the source code
@@VictorGordan I solved it i must take the texture to the ImageTexture folder in the .sln
is this faster than assimp?
This exact implementation? No, not at all. It's not good. But generally speaking if you make a custom glTF importer, then yes, it can be faster than assimp :)
And here I am trying to port all this shit to C.
Ooof, good luck!
@@VictorGordan I actually found something really cool called Assimp, which effectively parses all the data from most 3D model formats into a specific structure with all the data in it you'd need for vertices, indices, etc. It's got a C interface, so I'm gonna try implementing it first thing tomorrow.
Yeah, did I not mention assimp in the video? I chose not to use it for reasons I explained in the video as far as I remember
@@VictorGordan I don't remember you talking about Assimp in the video. Maybe you just wanted the project to be as dependency-light as possible?
Yeah, and I think that there being a shit ton of data formats for meshes is really annoying and I hope that glTF will be the future of mesh data formats
So this dont work for me at all - to the extent that I removed my project and just copied the source.
I get this
Cannot open include file: 'std_image.h': No such file or directory OpenGLGame C:\Programming\OpenGLGame\OpenGLGame\stb.cpp
I dont know why stb has stopped working :/
Maybe change "std_image.h" to "stb_image.h"? Otherwise the path is likely incorrect or you didn't properly link the stb library 🤷♂️
@@VictorGordan Your right - however I think Im going look into assimp instead.
Pls upload model loading tutorial with using assimp header files because assimp is better than JSON. how to edit loaded model in our program.
Hi ! Great video as always !
I tried to export a textured cube made with Blender in the correct format (separated GLTF) but it seems only the shape is rendered, and not the texture : I get a black cube as a result... any hint ?
Make sure the texture is named "diffuse" since that's required due to the way I made the model importer
@@VictorGordan I tried, but it still doesn't work (also the texture in the sword model doesn't have "diffuse" in its name) :( Maybe I should use another editor ?
The editor shouldn't be the problem 🤔
@@VictorGordan I see.
I see. May i know where the 3D models in the resources come from? I want to reproduce the exact same config
From sketchfab. Though I had to modify them slightly I think. As in changing the name of the texture in itself and also inside the .gltf file
Works in debug mode but not in release mode.
Yeah, I've gotten that comment before. Most likely it's my fault... but I wouldn't use this importer for any sort of release project haha
what does debug and release mode mean?@@VictorGordan
i'm not getting any erorrs, but it just doesn't work, the model isn't showing up, trust me, i copied almost every file now from your github, because it didn't work but still, it doesn't work, i'll try tomorrow, let's not ruin this day
ok, my computer has problems... it gets bluescreens and stuff, but my guess is that the problem doesn't lie in my code, it maybe lies in the model itself
E=YESS, i just copied the fragment source and it finally worked!
Lol that looks so complicated.I mean why did they have to make the code that confuse and complicated.
gltf is fucking terrible, i tried importing alot of gltf models but they just dont work so i made my own obj and ply parsers instead of this disfunctional format which was 20 times easier and 100% more working
To be fair, it's not gltf's fault. It's mine. This is not a good importer 😅
Doesn't work in VS 2022
Could you actually go faster?