BGFX / Babylon Native bug when using float vertex buffer shader attribute?

@BabylonNative @Cedric @bghgary
I’m not entirely sure this is a bug, but it’s certainly a difference between Babylon.js and Babylon Native.

I was trying to get @roland’s cool new greased line code working in Babylon React Native, but it kept crashing with the following error (in Android):

After much trial and error investigation using one of the simplest of Roland’s tests (pbrDemo()), I was able to determine that attribute float side was the cause of the crash. This side vertex buffer is defined and populated in GreasedLine.ts:

It works after changing from a float to a vec2 throughout like so:

image

image

image

Sorry for the mess of screenshots above, but hopefully it conveys the issue.

Is this a known limitation of BGFX or a bug?

1 Like

It was not a known limitation but at the same time, I’m not really surprised. It’s an uncommon case with just 1 float attribute. It’s never been tested AFAIK.

I’m opening an issue for that. crash with 1-float attribute vertex stream · Issue #1175 · BabylonJS/BabylonNative · GitHub

3 Likes

Thanks @Cedric! Much appreciated.

1 Like