Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchedText: billboard material #341

Open
upisfree opened this issue Nov 8, 2024 · 2 comments
Open

BatchedText: billboard material #341

upisfree opened this issue Nov 8, 2024 · 2 comments

Comments

@upisfree
Copy link

upisfree commented Nov 8, 2024

Hello again :)

I'm trying to combine BatchedText and your createBillboardMaterial, but I'm not good at shaders so I don't know why it doesn't work. Maybe I need to do some magic matrix stuff, but I can't figure it out which matrix to use :)

Could you please suggest what I'm doing wrong? Thanks again :D

createBillboardMaterial source (it works with usual Text class just fine):
#101 (comment)
https://codesandbox.io/s/createbillboardmaterial-xl6mt?file=/src/createBillboardMaterial.js:0-580

BatchedText + createBillboardMaterial — all texts are fixed in camera view

image
image

BatchedText + material without modifications — all texts are in right places, but they don't look at the camera

image

P. S. It might make sense to add the createBillboardMaterial implementation to the repository, since Text looking always at the camera is a very common request among developers?

@lojjic
Copy link
Collaborator

lojjic commented Nov 9, 2024

Hmm, that's a tricky one. I'll try to see if I can make the batched matrix transforms work with other custom shader transforms. But you may be right about this being a common option that would belong in the base shader.

@Methuselah96
Copy link

I am looking to use BatchedText with billboarding as well, text rendering is the most expensive part of our current three.js scene and would love to use BatchedText to speed things up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants