-
Notifications
You must be signed in to change notification settings - Fork 213
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
Snapping doesn't work well with low resolution terrains. #100
Comments
Hey @mihakrajnc, as you noted, default behaviour is to read from height data directly instead of doing raycast which would be a lot more expensive. Intended usage is to have the highest resolution you can for terrain and since it's quite low weight as it's only vertices anyway. |
That's exactly what I'm looking for! So far I've been doing the recalculations myself to modify the vertices and normals for that low-poly look, but it would be awesome to have it integrated. However won't that factory have the same problem? Snapping will still happen to the height data, and but the terrain will be low poly? |
@mihakrajnc ah yes, you're absolutely right, that terrain will have it even worse. Actually the ultimate solution is to cut terrain to create roads and stuff but that's a low performance solution so we didn't prioritize it. |
@mihakrajnc actually, let me correct that; low poly terrain in those shots are exactly same as the normal terrain (resolution wise) but have different shading. So snapping to terrain issue will be exactly same as the normal terrain, not any better or worse. With somewhat high resolution and a little height on roads, it'll probably stay on top of terrain most of the time. |
@mihakrajnc OK one last thing, have you tried SmoothLineModifier for your roads? It goes before everything in stack and increases road data resolution so it snaps better on terrain. Might worth giving it a shot as well. |
@mihakrajnc And by all means, if you need to raycast to obtain your height data, please do so. You could build your own version of |
@brnkhy Well, depending on what kind of low-poly look you're going for, the problem can still be there. If you want a really low poly look (which needs a low resolution terrain) the problem is still there. @david-rhodes I tried it with Raycasting and the results are looking good! I also tried a SmoothLineModifier and got better results in some cases. Still have to check the performance of this stack on mobile devices, but as the only impact will be when loading the map for the first time, it should be ok IMO. Here is the SnapTerrainRaycastModifier if anyone wants to use it! I'm not a huge fan of |
@mihakrajnc that shot looks really awesome! As long as it satisfies your performance needs, I guess this is the way to go in your case. Thanks a lot for the script as well, I'll try it as soon as possible! |
@mihakrajnc This is awesome!
I bet you could cache the Also, instead of serializing the string of the layer, you could use |
Ahh, I also added an P.S. Thanks for all the help guys 👍 |
@mihakrajnc We'll probably add the IMap property soon to UnityTile. The plan right now is to separate |
@mihakrajnc Thanks again: #110. |
I have a TerrainFactory with a 2x2 resolution (for a low-poly look) and the terrain snapping for roads doesn't work well in this case:
As the snapping modifier uses the height data of the terrain for snapping it works fine in cases with a high resolution terrain, but fails with low resolution.
Not sure what the fix for this would be... Worst case raycasting, best case, using the terrain resolution and some black magic to figure out the actual height of the terrain mesh?
My "workaround" for this was to use a map image factory with a custom style (that only includes roads) and retina resolution turned on, to get some feeling of roads, but I'd like to have them as meshes in the long term.
Using the latest develop: 61d740b
The text was updated successfully, but these errors were encountered: