unexpected frame drop when rendering jit.gl.text3d through a jit.gl.node

fraction's icon

Hello,
i m facing an issue with rendering several jit.gl.text3d through a jit.gl.node.

In this example, the patch load 12 jit.gl.text3d to the jit.world contect "myTest". You can change the text sent to all the jit.gl.text3d with the sender.

Now render all those object to the jit.gl.node by changing the drawto contex to highlevel. The fps is dropping down if your text is for instance "12345678" - it seems connected to the number of character to render.

Seems for Mac and Win, on glCore. gl2 works fine or it is less noticable.

Rendering "12345678" with 12x jit.gl.text3d through a jit.gl.node records a giant drop from 60 to 30 fps

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

Thanks much for the report and reproducible patcher. I can see places where we can improve text3d rendering speed.

In the meantime, I believe the easiest way to fix this is to use jit.gl.mesh for drawing. Simply send jit.gl.text3d automatic 0 matrixoutput 1 matrix output through a concat.drawgroups abstraction to a jit.gl.mesh @drawmode triangles, and use the mesh as the actual rendering source and fps should be greatly improved.

Here's an updated abstraction:

Max Patch
Copy patch and select New From Clipboard in Max.

fraction's icon

Thanks a lot Rob. It seems indeed to fix it. I m going to re-evaluate other part of the text i use through this work around because it seems to provide an overall higher AND better fps stability.
thx !!!

fraction's icon

Hi Rob,
so on the fps side, it seems much better as i said yesterday. But inside a standalone, the behavior of this flow is too fragile, and i can't draw the text properly. The problem comes from the bang to the zl reg inside the abstraction. When you are in native max, the process is quick enough so banging the reg will likely output the final matrix. It's still by nature a bit uncertain as that process never really know how much matrix it should expect before sending that bang to the reg, assuming the final matrix is there already. And inside a standalone, either way, the concat is too slow or the bang is too quick, and most of the time the zl reg is empty. It's too uncertain, and user machine are too various to rely on this. So i made a quick js that might help. I have a better result so far. It simply counts the character in the text and compare to the number of times we get the matrix out for each character, validating a bang at final stage. I modify a bit the patch. Let me know if you think that can be helpful.

jitterText.zip
application/zip 8.84 KB