Am I correct in understanding that old school bump maps (grayscale images, basically height maps) are not supported by babylon.js?
If so, is there any bundled converted to transform a height map into a normal map in a fast, possibly GPU-assisted, way or should I write my own code for that?
I found very little to document this, but at least one mention where it was stated that height-map bump maps was not supported since they are slower than normal maps and that you should transform them in advance offline. I fully agree on this in general, but in my case the height-map based bump maps comes from legacy data not easily transformed on server side.
As a reference, Three.js supports both height-maps (called bump maps) in conjunction with the normal normal maps, pun intended. =)
If the conversion code is generic enough then I will try and contribute back. Might turn out too messy though depending on where in our pipeline it ends up.
Thanks. I have actually using that to provide some test files and as a “ground truth”. Looking at the source it is actually a MIT license, so perhaps I could use some of the logic from it.
That said, I read somewhere that it is using shaders to do the conversion (which is actually not that hard math wise) which is still outside of my comfort zone.
Also for the sake of performance you should not do offline work at runtime because you will pay the cost of conversion on each launch when it could be done once and for all