BJS 6: Same scene, different performance numbers. Where to start?

You could always bake the scene into a .babylon or .glb file using inspector in 5.7, then load that in 6.x to perfectly recreate scene conditions / cameras / lights. That eliminates the ability for things to mismatch / move around and you get a true apples to apples comparison for scene profiling.

@jeremy-coleman @Calsa Probably try a combination these things. I’ve tried saving a scene as a babyonjs file, but it still reaches out for the same resources, and I’d have to some how get those to “bake” in. Right now, though, I am 100% confident the source code and the objects loaded are exactly the same. They might be loaded in different orders depending on network timing, caching, etc… or maybe GLB files (which EVERYTHING starts as) are processed differently in 6.0. I’m still chasing it.

Found the problem. Wow… ok, so in a big way, @Evgeni_Popov was right! The problem came down to a Webpack optimization problem. There was a boolean flag determining whether or not to create the shadow generator with a hardcoded value (for testing) set prior. In the v6 version, optimization was on and source maps were excluded… which forced that flag to just be true. In the non-optimized version… the BJS 5 version… the code worked as written.

I’ve run into this issue a couple times. Drives me crazy. I should have checked first, but it took @Evgeni_Popov’s nudge to get me there.

THANK YOU EVERYONE for your help! (And hat tip to @Evgeni_Popov!)

1 Like

This was the first thing that I was thinking about, but @jholmes stated the sources are identical… Arghhh…