Confused about lighting imported models. The only kind of light that will illuminate my model (using the Shark BJS model) is a Hemi. Every other light type won’t light up the model. Model works fine in sandbox (assume there’s a Hemi in there). What concept am I not getting?
Well that was interesting. When I display normals, they form a massive (1000x) bigger shark above the shark. So this means that, somehow, normals have been scaled, while the model remained small?
The normal seem fine to me but the positions are not.
It’s like a scaling issue between the bindpose and the animation.
But at the same time, the normals computed by skinning should be computed the same way as positions.
Your animation is using skin mesh?
Hm, not sure about the animation - i just grabbed the stock BJS shark model. Maybe the extra large normals are a red herring though. Here’s a similar example where the normals look totally fine (right sized) - but still no illumination on the model:
(side note: i do notice that when i move an imported GLB around the scene using position.x, its normals stay in the position to which it was originally imported.)
Thanks @sebavan. The same does not seem to be true for GLTFs that are not PBRs? For the second example model (which is actually the model i’m working with, versus the shark, which i’d just used as a BJS standard), the env lighting does make a difference, but only a bit. Ie: still hard to see the model in the space. Any tips for lighting a non-PBR in GLTF format? Or would you just convert to some other format that works better with BJS?
ps. I tried exporting it as a .babylon file from Blender, but same result. here’s the export log:
Exporter version: 6.1.2, Blender version: 2.80 (sub 75)
========= Conversion from Blender to Babylon.js =========
Scene settings used :
inline textures : false
Material Type : PBR
Positions Precision : 4
Normals Precision : 3
UVs Precision : 3
Vert Color Precision: 3
Mat Weight Precision: 2
texture directory : public/models/astrolowpoly/
Python World class constructor completed
processing begun of camera (UniversalCamera): Camera
processing begun of mesh: Astronaut_mesh
processing begun of material: Astronaut_mat
WARNING: unsupported node type(ShaderNodeMixRGB) will trigger baking
processing texture
texture type: diffuseTexture, mapped using: "TEXCOORD_0"
Baking texture, type: DIFFUSE, mapped using: TEXCOORD_0
processing texture Astronaut_mat_DIFFUSE
texture type: diffuseTexture, mapped using: "TEXCOORD_0"
bake time: 0 min, 1.7102 secs
Custom split normals with tangents being used
num positions : 3322
num normals : 3322
num tangents : 3322
num uvs : 6644
num uvs2 : 0
num colors : 0
num indices : 4812
processing begun of light (POINT): fill
processing begun of light (POINT): key
processing begun of light (POINT): back
========= Writing of JSON file started =========
========= Writing of JSON file completed =========
========= end of processing =========
elapsed time: 0 min, 2.1686 secs
Thanks for post and the solution, bigrig and sebavan! This literally saved my life: a masked intruder broke into my house, held a gun to my head, and demanded that I get my imported meshes to illuminate with non-hemispheric lights. I said, “Okay, let me check the Babylon forum first…”
Now, not only do the point lights work on the mesh, but the hemispheric lighting even looks better.
(Oh, the masked intruder was satisfied enough that he left without another word, but my front door is still shattered to pieces.)