-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Better cities and towns labels in 3D view #635
Conversation
That's kinda cool, I love it! Will share on Discord so that people can give a feedback. A couple of suggestions:
@evolvedexperiment, please review as well if you have time. |
Burg.labels.3d.mp4 |
I'm glad you like it!
Capture.d.ecran.video.de.21-06-2021.21_08_52.mp4
PS: I'm French so there's probably some problem in my message, don't mind it |
It looks much better. The labels were changing position too unpredictable, as least for me. For the elevation - no need to extract burg data from svg, all the data is available as As for size - it requires testing, maybe the current variant is the best. |
I already get the elevation from For the size I think the actual values are good, the only problem is that it's hardcoded. |
It looks great. I didn't find any bugs. The only thing I'd suggest is to use the label colours from the style. |
Well, as the pull request has not been merged yet, I take the opportunity to add the state labels. By the way, I totally replaced the canvas by an svg (because I need textpaths). And now the labels toggle doesn't do a full reload anymore (but causes a huge freeze). |
Hello, will you continue to work on it? |
No, I don't see anything more to add, you can merge the pull request. |
Hello, please check the comment above. I believe some cleansing required before merging. |
Everything is fixed now |
thanks for the update, it looks good. Just a few issues:
|
I fixed some issues but I' ll wait your answer before making a commit:
|
I tested several fonts and I just realized that some of them do not work, I will investigate this tomorrow |
thanks! |
Thanks, I will try to review the PR next week. |
Hello, I'm ok to merge, but still believe there is room for improvement.
|
Capture.d.ecran.video.de.05-07-2021.18_16_54.mp4
|
It would be nice if all labels can be rendered from the same texture, but yes, I'm not sure whether it's possible. But creating a separate svg with font embedded for each label, and then turning it to canvas, that's definitely not the best way to handle it. Burg[0] is a placeholder showing that element 0 is "no burg". I keep it for historical compatibility issues. It would be much faster to just skip first element than slice the whole array. |
Rendering all labels on the same texture and tweaking the mesh UVs is probably possible, but it would result in overlapping labels as they are scaled up for better quality. But the current solution has no impact on performance, except during the initial freeze, as the svg are turned into normal textures by the TextureLoader. |
I believe it depends on you PC, for me it's acceptable, but close to freeze. So UX is kinda bad. I would really like to get it better. The current labels quality is still pretty low, so I believe so other approach van be tested. But that's up to you. The only real difference is that if it runs faster, we can turn the option on de default. As for slice() - it copies the array, losing links, so basically provides a copy of you array if you don't have advanced stuff inside. For loops should be both optimized, browsers had some issues with them, but now the consensus is that js engines can handle all them in an optimal way. |
So, I reverted to using a canvas for the town labels, which makes the loading much faster (the state labels don't use a canvas because curved text is no possible with them). I also increased the quality of both types of labels, but it may not be enough for large monitors (should I create an option to change it manually ?). |
I believe it's fine, need to find some time for a final review and then merge |
Merged, thanks for the contribution! |
I have played with it a bit and the performance happen to be very bad. I have added some optimizations and finally moved from canvas text to sprites Sprites have better quality and we don't need to change their position as sprites always face user). I've also change icon style to be more interesting and fixed a couple of bugs. |
Wow really better performance, I didn't know about Sprites. I found some possible improvements:
You can check these changes here : Rayzeq/Fantasy-Map-Generator , I didn't make a pull request because there are only 4 lines to edit. |
Cool, I've added these improvements as well. I've also think about rendering state borders as 3d path, as texture resolution is too low. Actually, we can use SVGRenderer instead of raster, but it would be really hard to make huge svg to work fast. So we can make 3d just some elements that work bad as texture (like borders, markers and so on). |
Yes, this is the main reason I decided to separate the labels from the landscape. I think we could use lines and small 3D models (like town icons). |
Ok, let's see how it goes |
I've done state borders using lines (Rayzeq/Fantasy-Map-Generator it's just a proof of concept, absolutely not clean and debugged) but I don't know if that's a good idea, as lines in OpenGL/WebGL are not actively supported and unofficially deprecated (or not designed to be actually used). |
That's interesting, but I wasn't able to check it life, how is it supposed to work? |
Normally you just go to the 3d view to see the lines, but your webgl implementation may not support lines at all. I didn't think that lines were so badly supported, it is probably necessary to use meshes. |
I also plan to do the state labels, but I have some difficulties so it might take more time