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
Can objects (roads, buildings) be textured? #31
Comments
No problem man ;) Road UV's should be quite easy really, I can easily do that. Landuse UV is harder, not sure about those. Water is extremely easy as well. But the real problem is the building UVs I did a little experiment on building UVs last night; http://imgur.com/AFZBScY Roads would be easy as I said, but they'll look ugly even if I do the UVs as they are disconnected in most place. And that's the osm data, not my generation code so cannot really fix that without huge effort either :( I fucking love working with vertices, indices, triangles,uvs or generating meshes in general but damn they take sooo much time. Still, as I said, I can get roads and water UV working in a day I believe. |
Well, I've been enjoying looking through your code in the various factories for inspiration. I can certainly appreciate the amount of effort. I know zip about UVs though. I'll try to do some research and see if I can get up to speed fast enough to be of any use. |
I pushed the simple UV thing on dev branch last night, it's in the building factory (that should be tidied up though, that function is a total mess, hard to read and confusing at the moment) so wait wait, I'll try to clarify it all; to me there is two ways of solving this problem (considering just one building at the moment though);
2)subdivide side walls (this would be haaaard..... I guess) and use one texture/atlas for roof&side walls. Admittedly this sounds worse and worse as I keep writing. we'll have to create sooooo many extra vertices just to save extra draw calls..... damn I have no idea which one is better really. As you can see, I'm confused as hell john, help me out with this :) |
Am I looking at the right documentation for the TriangleNet you're using? It looks like very useful stuff. Also, noob question, will that dll compile onto android? If yes, is it because it's an "unmanaged" dll? or do you have to put the source in? |
it should compile on android yea, both managed and unmanaged dll would I believe. If not, we can always use the source code, I just thought it'll be easier with one file instead of dozens in the source. |
So, I've been playing with your dev buildingfactory and have found a different issue that effects this one and performance: If a building is on multiple tiles then multiple buildings are generated. I'm using tilesize of 600 and a zoom of 18 here. I pulled the buildings apart in the scene so you could see them. Obviously, I've got the mergemeshes flag set true. This building just happened to straddle 4 different tiles, so 4 different meshes were generated. Should I create a new issue for this? |
I want to say however, that textures on buildings is working (when mergmeshes == true). I can resize the textures using the tiling property. Roofs would be cool but great work in such a short time. Fixing the multiple buildings problem will get rid of the weird shimmer. And, as far as I can tell, buildings are the only thing being duplicated. Roads and water seem unaffected, since they're just 2d polygons. |
Double buildings is a known issue (but not logged, my bad). It was actually "fixed" by a simple hashset check but then I realized, destroyed buildings wasn't removed off that list so deleted it all together. Fix is rather easy, all we need is a simple destroyed event on tile objects but.... I was being lazy. well yea textures are "working" but it's rather useless at this state. That building in your screenshot looks like a slice of cheese :) |
pushed on the master branch, we can open new issues for further improvements |
This may be totally due to my ignorance of unity materials and textures, which is vast, but I can't seem to get a textured material to render properly on roads or buildings.
Sorry to create an "issue" out of it, Baran.
The text was updated successfully, but these errors were encountered: