Author Topic: MD5 error/textures not loading  (Read 10242 times)

TedBudstorm

  • Jr. Member
  • **
  • Posts: 4
MD5 error/textures not loading
« on: May 06, 2015, 11:03:46 PM »
I was just learning how to use Bonzai Engine and I am getting this error when trying to use MD5 models and animations, and some textures are not loading.

Console output:

OpenGL api: JOGAMP
Viewport(0,0,640,480)
Viewport(0,0,640,480)
Viewport(0,0,640,480)
OpenGL version: 44
Texture read: font-bmf:res/fonts/CourrierNew16_0.tga
Texture loaded: font-bmf:res/fonts/CourrierNew16_0.tga (1)
Texture not read: bob_head_d.tga
Texture not read: bob_helmet_d.tga
Texture not read: bob_body_d.tga
Texture not read: lantern_d.tga
Texture not read: lantern_top_d.tga
Texture read: lantern_top_local.tga
Texture loaded: lantern_top_local.tga (2)
Shader loaded: 280/0
Texture read: bob_head_local.tga
Texture loaded: bob_head_local.tga (3)
Texture read: bob_body_s.tga
Texture read: bob_helmet_s.tga
Texture read: lantern_local.tga
Texture not read: lantern_top_s.tga
Texture not read: lantern_s.tga
Texture read: bob_head_s.tga
Texture read: bob_helmet_local.tga
Texture loaded: lantern_local.tga (4)
Texture loaded: bob_helmet_local.tga (5)
Texture loaded: bob_head_s.tga (6)
Texture loaded: bob_helmet_s.tga (7)
Texture loaded: bob_body_s.tga (8)
Texture read: bob_body_local.tga
Texture read: bob_helmet_h.tga
Texture read: bob_body_h.tga
Texture read: lantern_h.tga
Texture read: lantern_top_h.tga
Split tangents: 1/176
Split tangents: 12/10
Texture loaded: bob_body_h.tga (9)
Texture loaded: lantern_top_h.tga (10)
Texture loaded: bob_body_local.tga (11)
Texture loaded: bob_helmet_h.tga (12)
Texture loaded: lantern_h.tga (13)
Texture read: bob_head_h.tga
Shader loaded: 4002a0/0
Split tangents: 80/26
Split tangents: 63/15
Split tangents: 392/236
java.lang.NullPointerException
   at com.bonzaiengine.model.SkinData.skinVerticesCpu(Unknown Source)
   at com.bonzaiengine.model.GeometryData.onVerticesAccess(Unknown Source)
   at p.bb.a(Unknown Source)
   at p.bb.a(Unknown Source)
   at p.bb.a(Unknown Source)
   at p.bb.a(Unknown Source)
   at p.bb.a(Unknown Source)
   at com.bonzaiengine.renderer.RendererPipeline.renderModelSolid(Unknown Source)
   at p.bf.a(Unknown Source)
   at com.bonzaiengine.renderer.RendererPipeline.render(Unknown Source)
   at com.bonzaiengine.renderer.RendererPipeline.render(Unknown Source)
   at com.bonzaiengine.renderer.RendererPipeline.render(Unknown Source)
   at com.bonzaiengine.model.ModelInstance.render(Unknown Source)
   at tut1.ModelLoader.render(ModelLoader.java:232)
   at com.bonzaiengine.scene.SceneView.render(Unknown Source)
   at com.bonzaiengine.scene.Scene.render(Unknown Source)
   at p.bt.display(Unknown Source)
   at com.bonzaiengine.scene.target.jogl2.NativeWindow_jogl2.display(Unknown Source)
   at jogamp.opengl.GLDrawableHelper.displayImpl(Unknown Source)
   at jogamp.opengl.GLDrawableHelper.display(Unknown Source)
   at jogamp.opengl.GLAutoDrawableBase$2.run(Unknown Source)
   at jogamp.opengl.GLDrawableHelper.invokeGLImpl(Unknown Source)
   at jogamp.opengl.GLDrawableHelper.invokeGL(Unknown Source)
   at com.jogamp.newt.opengl.GLWindow.display(Unknown Source)
   at com.bonzaiengine.scene.target.jogl2.NativeWindow_jogl2.onDisplay(Unknown Source)
   at com.bonzaiengine.opengl.RenderLoop$a.run(Unknown Source)
Texture loaded: bob_head_h.tga (14)
Shader loaded: 44002a0/0


« Last Edit: May 06, 2015, 11:09:18 PM by TedBudstorm »

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: MD5 error/textures not loading
« Reply #1 on: May 07, 2015, 10:02:11 AM »
There seem to be some problem with the cpu skining code with your model, which seem to be used because the shader is not yet loaded.
The best would be to send us the model so we can fix it (via the forum or our contact email). In the meantime, and as a workaround, you can request a shader only context to ensure the cpu skinning code is not used. To do that, you can use DisplayCapabilities.setGLApiVersion with for example 30.

About the texture not found, can you locate them ?
Where are they related to the model ?
« Last Edit: May 07, 2015, 10:06:40 AM by jerome_j »

TedBudstorm

  • Jr. Member
  • **
  • Posts: 4
Re: MD5 error/textures not loading
« Reply #2 on: May 07, 2015, 11:03:57 AM »
The textures are located in the same location as the MD5 model

Like

>res/models/md5/bob_lamp_update.md5mesh
>res/models/md5/bob_lamp_update.md5anim
>res/models/md5/bob_body.tga

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: MD5 error/textures not loading
« Reply #3 on: May 07, 2015, 12:50:27 PM »
Most of the texture not found are the diffuse. MD5 format don't explictly reference the texture files, by default the engine use the following pattern:
  • <shader>_d for diffuse texture
  • <shader>_s for specular texture
  • <shader>_h for height texture
  • <shader>_local for normal texture

So for bob_body.tga, you should rename it to bob_body_d.tga
If you don't wish to rename any file, there's some way to plug some callback when a texture is not found (ex: bob_body.tga) and try to open another one (ex: bob_body_d.tga) by code.

I'll give a look to your model, when I can.

TedBudstorm

  • Jr. Member
  • **
  • Posts: 4
Re: MD5 error/textures not loading
« Reply #4 on: May 07, 2015, 01:36:30 PM »
Okay, I fixed all of the file names, and now I get this


jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: MD5 error/textures not loading
« Reply #5 on: May 07, 2015, 02:04:44 PM »
I think the "Implicit version number 110" error was fixed in the 1.3.3 dev builds.
« Last Edit: June 10, 2015, 08:18:28 PM by jerome_j »

TedBudstorm

  • Jr. Member
  • **
  • Posts: 4
Re: MD5 error/textures not loading
« Reply #6 on: May 07, 2015, 03:36:49 PM »
Yeah, that seems to have worked, thanks. :)