Blender model converted to glb very dark

Hi,

I’m trying to use the following model in my game: https://free3d.com/3d-model/wolf-rigged-and-game-ready-42808.html

I downoaded it in Blender format, and from Blender exported it to glb (I think that from what I’ve read it means binary gltf). The model is very dark, almost black. But it’s not a texture issue as I do see them when I change some lighting settings. Before using this wolf I was using the standard Panda3d panda with my current settings and was having no issue.

My lighting settings:

# Add fog
    myFog = Fog("Fog")
    myFog.setColor(0.2, 0.1, 0.1)
    myFog.setExpDensity(0.001)
    self.render.setFog(myFog)

    # Lightning
    plight = PointLight('plight')
    plight.setColor((1, 1, 1, 1))
    plnp = self.render.attachNewNode(plight)
    plnp.setPos(16*32, 16*32, 200)
    self.render.setLight(plnp)
    plight.setShadowCaster(True, 1024, 1024)
    # Ambient light
    alight = AmbientLight('alight')
    alight.setColor((0.2, 0.1, 0.1, 1))
    alnp = self.render.attachNewNode(alight)
    self.render.setLight(alnp)
    self.render.setShaderAuto()

    # Background
    self.render.setColorScale(1, 0.8, 0.8, 1)

Any help on that? Thanks

Actually, if that can help narrow things down, the textures are showing with simplepbr (but then the rest of my scene becomes very dark…), but they do not show otherwise. I checked the model with the gltf viewer and it works fine.

I suspect this has to do with sRGB textures, which glTF uses by default and requires an sRGB framebuffer to appear correctly. The gltf-viewer makes use of panda3d-simplepbr which uses an sRGB framebuffer. You can get an sRGB framebuffer by:

  • Setting framebuffer-srgb true in PRC data
  • Using the sRGB Encode filter from CommonFilter (new in 1.10.7)
  • Use panda3d-simplepbr library

You can also instruct panda3d-gltf to not use sRGB textures:

  • Use --no-srgb when using gltf2bam
  • Setting no_srgb to True in GltfSettings (gltf.GltfLoader.global_settings = gltf.GltfSettings(no_srgb=True)