1

I'm following the LearnOpenGL tutorials over at learnopengl.com to load in a model using assimp and render it with glfw.

Unfortunately all I'm getting is an empty black window....

enter image description here

My code is identical to Joey's tutorial source here:

https://learnopengl.com/code_viewer_gh.php?code=src/3.model_loading/1.model_loading/model_loading.cpp

More than anything I'm just at a loss as to how to debug a problem like this, looking at the model it has clearly loaded in the mesh data:

enter image description here

I'm not really expecting an answer here but if anyone could give advice on how to debug an issue like this when I'm getting nothing back from the compiler or the logger... I'd be grateful!

**************** UPDATE ***************

So I grabbed RenderDoc, the Mesh Output shows nothing:

enter image description here

But the "Errors and Warnings" windows is blank...

I re-downloaded GLAD incase there were extensions I was missing, no success there. I also swapped GLAD for GLEW to see if that would make any difference, no joy.

Also I found a simplified version of this tutorial on YouTube and swapped all the Mesh/Model/Main code for that... and no effect, just a black window.

I have no idea where this leaves me...

BouncingCzech
  • 103
  • 1
  • 7
  • 2
    Did you download the necessary shader files too? ("1.model_loading.vs" and "1.model_loading.fs"). Without them I don't think the model will be lighted properly and won't be visible. – jpw Sep 11 '18 at 12:40
  • 1
    If you are seeing mesh data loaded then definitely problem lies in code that renders it. Now you can break code that renders it into many sub modules and check each one. Like check initialization function. Check where you are compiling shaders is there any error. – Paritosh Kulkarni Sep 11 '18 at 13:52
  • 1
    Use RenderDoc or Intel GPA to capture frame and check what data goes to API. – Michael Nastenko Sep 11 '18 at 14:07
  • 1
    GL has a fairly comprehensive error system. Are you checking return values when compiling & linking shaders, drawing, etc.? – 3Dave Sep 11 '18 at 14:28
  • Thanks guys, yes I have the shader files (I get an error without them) and they compile without error. I'll try and figure out how to turn on OpenGL debugging and maybe give RenderDoc/GPA a go. P.S.... not sure the downvote for the question was entirely fair... – BouncingCzech Sep 11 '18 at 16:09
  • 1
    Did you copy & paste the code from the tuto or you made some change, even a tiny one? – Ripi2 Sep 11 '18 at 17:07
  • Initially I wrote it out myself and then when I had this same error I just downloaded the code files for the tutorial and used those... same problem :-( – BouncingCzech Sep 11 '18 at 19:00
  • 1
    This is a not-basic OGL example. Do previous examples work for you? – Ripi2 Sep 11 '18 at 22:51
  • They do yes I've built up to this point. – BouncingCzech Sep 12 '18 at 09:11

1 Answers1

0

Got it! All this time looking for low-level OpenGL issues and it's the model matrix that is the issue...

The tutorial code never initialises the model matrix, so it's just garbage:

enter image description here

How this works for others I'm not sure but as soon as I initialised that to the identity matrix it renders fine!

Thanks to everyone who replied.

BouncingCzech
  • 103
  • 1
  • 7