leochocolat / three-msdf-text-utils

110 stars 6 forks source link

Support for Instancing msdf text #3

Open SrinivasPrabhu794 opened 6 months ago

SrinivasPrabhu794 commented 6 months ago

Hi @leochocolat

Is there a possibility of adding instancing support for text rendering? I am using this library for font rendering but I would also like to have 2000+ text rendered sometimes in my application at different locations. Having instancing would make sure the application can render innumerable amounts of text without any issues.

This example here uses instancing to render text: https://stackoverflow.com/questions/76514035/how-to-render-1000-2d-text-labels-using-three-js

But this does not use msdf font rendering (rather just creates a static texture atlas using a giant canvas) and also you cannot scale up or down the size of fonts at runtime once the texture atlas is created.

Would it be possible for you to get this feature implemented? Or could you guide me on how I can approach to solve this issue ? :)

leochocolat commented 5 months ago

Hi @SrinivasPrabhu794 ! Indeed it could be a great feature... I don't have a super clear idea of how it would work yet but I'll try to work on it soon! Open to suggestions if anybody see this! :) Cheers

SrinivasPrabhu794 commented 5 months ago

Thank you @leochocolat