Issues with Insufficient buffer size when updating to BJS 5.4

I am testing the latest BabylonJS on a project and am getting Insufficient buffer size errors and am seeing render issues. Looking for ideas on where to start to troubleshoot this issue…

Source for the viewer is available here GitHub - Sindarius/npm_gcodeviewer

what version are you currently using? 4.X, or a previous 5.X version?

Pinging @sebavan who is the master of all things :slight_smile:

@RaananW I currently use 4.2.1 and was testing 5.4.0 without making any changes to see if it would be a clean transition.
I use var colorData = lineMesh.getVerticesData(VertexBuffer.ColorKind); to get the color array of a line mesh in this case and I update the colors. After the initial render it does not appear that the color data is updating properly in the 5.4.0 version.

The sample in the picture is using my line render mode, this is a gcode viewer. But I am having problems with color changing in other modes as well but it is significantly worse in line render mode.

Looks like the buffer is growing in size during the manipulation with is pretty weird.

Could you make a smaller repro in the playground ? I can not seem to be able to repro on other vertex color updates.

That’s very odd. I’ll try to see if I can get something put together in a playground. Exact same code works without error flawlessly in 4.x.

1 Like

Yup I am pretty sure we have a regression somewhere and I d like to address it ASAP but would be great to have the smaller repro.

1 Like

I’ll try to get something put together :+1:

1 Like

I couldn’t get quite the same error as my application but I do get a GL_INVALID_OPERATION when applying a StandardMaterial to the mesh and then attempting to do similar logic as my application. In my application I commented out applying the material and the line mesh version of the view looks correct now and is not producing the buffer errors. So something with applying a StandardMaterial to a mesh where you are reading the ColorKind vertex buffer may be a hint into the issue.

I have a separate issue where I can’t update colors on thinInstances in 5.4 where I could in 4.2.1 and I can open a separate bug for that though I think there was one similar to it.

@Cedric @Evgeni_Popov I know there was a change in this area, do you have any updates on it ?

I think it should be fixed by

You can check it with the test envirronement.

I’ll pull down the latest and take a look. I tried making a playground and could not get the same issue to recreate that I am seeing in the gcode viewer so I may be missing something else for the thinInstance version. I use thin instanced cylinders to simulate extrusions and thinInstance is about the only way to make that feasible. Will get back on that later today hopefully.

Also materials were not settable on lineMesh before 5. But they come with restrictions with what is allowed as they do not work like PBR, Standard and so on.

Mainly it is to set other shaders but similar to the lineMesh embedded shaders.

Then more than likely the solution would be for me to remove the new standard material from the line mesh. If it wasn’t actually being applied in 4 then maybe that’s what is breaking it in 5 in my instance.

1 Like

At least it makes it work here

It looks like 5.5 fixed the issue I was having with updating thinInstance colors.

1 Like

Yeah and removing the material from my viewer appears to have resolved the issue for line mesh rendeirng as well. With removing StandardMaterial from linemesh and with the 5.5 update fixing thinInstance I appear to be back in working order again!