-
Notifications
You must be signed in to change notification settings - Fork 89
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
Line stipple / texture rendering problems #1005
Comments
The problem are the hardcoded "*8" values: The screenshots show the OpenAndroMaps Austria map, with Elements style at 47.63082°, 15.69521°. |
When removing the "*8" factor then I is drawn correctly, but II is wrong again.
|
Thanks for the details. Mapsforge and VTM are different map engines and their themes are not fully compatible. These values are active in the case of Mapsforge themes. |
What I don't understand is why the values have to multiplied by factor 8 for Mapsforge themes? The stipple size is already defined by means of the theme's "stroke-dasharray" attribute, isn't it? |
Can you try absolute values, does it work with all Mapsforge theme rules and everywhere? As they are different engines, value 2 in Mapsforge could need 4 in OpenGL (or vice versa), Rendering stipples in VTM themes seems to work properly (see the VTM themes). Rendering Mapsforge themes with VTM engine is different, a translation is needed. |
Actually this code (starting with line 613 in XmlThemeBuilder.java) ignores the space length:
It would only make sense if the check is |
In the case of a 2-value dash array, it is better for rendering and performance to use stipples instead of textures. What is space length? Odd number of dash array entries is duplicated, so 1 becomes 2. |
Sorry, I meant this with "space length":
For testing purposes I changed the check |
Different values mean texture rendering instead of stipples.
Then dash arrays with 2 values will use the texture rendering.
Indeed and so far there is no easy solution to properly render Mapsforge / OpenAndroMaps / Freizeitkarte themes in VTM. It's all a never-ending cycle, making one case better and another worse. |
Let's try your suggestions and see how it works. Then there is the case that Mapsforge dash arrays with small values do not appear as dashed lines in VTM (#983). |
Thanks. Another thing is that the line widths do not fully scale, i.e. the Mapsforge renderer fills the whole street width with the orange/white pattern, while the VTM renderer does not fill it in higher zoom levels. It seems as if the VTM renderer has a maximum width limit but I am still trying to figure out how this actually works. |
There is the parameter |
Also OpenGL has limits, see #121 (comment). |
Better change this line in
to
Now lines (even with thin dash pattern) look much better, almost like Mapsforge. |
Better (move this into the loop):
|
With this fix you no longer need to set the |
It is still the same small dashes and the green line still has 2 different renderings between zoom levels. |
I can reproduce the problem with the Freizeitkarte too. OAM maps + themes seem to work fine though. |
I think the problem is this check in the
Freizeitkarte uses dash sizes < 1, while OAM uses sizes >= 1. |
Android / Java bitmaps used in line dashed textures have integer width and height. |
Yes, this is what I meant. |
The Mapsforge renderer uses this:
Maybe we can use this somehow... |
See #1008. |
Mapsforge rendering at large zooms isn't the best (extending width but not dash length), |
With #1008 it should be better. |
The commit "707e1c406984bb22567133cea426bf6519246a97" (707e1c4) introduces new rendering problems with OpenAndroMaps Elements/Elevate themes:
Before (I is ok, II is no ok):
![image](https://user-images.githubusercontent.com/5980561/211208455-c86fc30c-20d4-43b0-8d81-5d905a458db2.png)
after the patch (I is not ok, II is ok):
![image](https://user-images.githubusercontent.com/5980561/211208484-9c8c69e7-5268-48c6-b1ac-6b29f13c903c.png)
The text was updated successfully, but these errors were encountered: