I’m revisiting babylon, and updated it to latest. Just starting fresh again, so i honestly can’t remember 90% of what I was doing. After updating, the scene looks quite different. I went from v4.2 to v5.5
Any ideas as to why? Is there stuff I need to change/update? If so, what should I be migrating?
On Latest:
On v4:
I think its related to browsers requiring a value for highp in sampler2Dshadow , but i dont remember the quick fix. There was a thread about it that seems to have been deleted. I remember a sample scene of mine having the same issue. Im on my phone so not so easy to try for me, but in ur code in the init function, id try changing settings in the babylon.shadowgenerator
Thanks for the reply! I’ve poked around the settings, but really don’t know what to change or to what value ![:thinking: :thinking:](https://emoji.discourse-cdn.com/win10/thinking.png?v=12)
hmm, i changed the alphas on your “createDimmer” setup. around lines 1200. seems a little closer?
it really seems though, like the top ground isnt receiving the directional light? in the v4 it seems like the sun is shining on the ground, but v5 that is gone.
Oh, the undersides of the meshes are being illuminated ![:thinking: :thinking:](https://emoji.discourse-cdn.com/win10/thinking.png?v=12)
Same issue I had way back here Different meshes that share the same material, batching drawcalls? - #14 by Evgeni_Popov
This was previously solved by passing in a boolean argument to addMesh
to indicate right handedness. However since I am using a single merged mesh here, and there is no addMesh
call, I may need to indicate this somewhere else?
Seems something regarding the left/right handed system changed in v5 ![:thinking: :thinking:](https://emoji.discourse-cdn.com/win10/thinking.png?v=12)
Edit:
using toLeftHanded()
on the prefab doesn’t seem to do the trick.
yup sounds weird @Evgeni_Popov might be able to enlighten us on this one ?
For me, this is a bug in 4.2.
The __root__
node is created by the glTF loader to transform right-handed geometry into left-handed geometry. However, this also leads to the inversion of the face winding and it would break the rendering if we did nothing. So we also update the overrideMaterialSideOrientation
of the meshes with the correct value to change the winding.
In your code, you delete the __root__
node but don’t change the overrideMaterialSideOrientation
of the meshes, so the winding turns out to be wrong for those meshes. This should break in 4.2 as well as in 5.0, but apparently there is a bug that makes it “work”…
The solution is either to remove overrideMaterialSideOrientation
for these meshes (set the property to undefined
), or to set scene.useRightHandedSystem = true
, because in the latter case the transformation of the __root__
node is the identity, so we don’t set a value for overrideMaterialSideOrientation
.
2 Likes
for posterity, here is a working pg
just added 1 line to line 1083
2 Likes