Osm2city.py textures: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 13: Line 13:
# textures that don't wrap around must come in 2^n sizes (32, 64, 128px ...)
# textures that don't wrap around must come in 2^n sizes (32, 64, 128px ...)
# textures that wrap around in one direction will be resized to (currently hardcoded) 256 px in that direction
# textures that wrap around in one direction will be resized to (currently hardcoded) 256 px in that direction
== Conventions Used ==
The following lists some naming conventions, which you must follow when placing files into the directory structure, naming files etc. Some of these conventions are hard-coded in osm2city related programs.
Regions (actually here synonym for country):
* Use the ISO 3166 alpha 2 country codes. E.g. US for USA, DE for Germany, GB for United Kingdom (do not use UK).
* Only top-level directories should be called with 2-letter country codes.
* If you do not know the country, use a good guess.
* Currently there is no mechanism to distinguish textures within a country - e.g. in Switzerland low-lands vs. Italian speaking mountains.
File naming:
* A suffix "_LM" denotes a lightmap for a texture (needs to have an otherwise exact same name)
* A suffix "_MA" can be used for a mask pre-processing a lightmap. The file is not used in the texture atlas, but can be handy to keep.
* A prefix of "roof_" is used for textures of roofs.
Texture registrations:
* All roofs shall be registered in a file with prefix "roofs_" and having the file type ".py". You must have very good reasons not to just register in the default file "roofs_default.py" in the top level directory.
* Textures for facades can be registered in different files, but it is recommended to use fewer rather than many files - maybe just one file per region within the region specific directory.


== texGUI.py ==
== texGUI.py ==
Line 82: Line 100:


== Install texture and lightmap ==
== Install texture and lightmap ==
* copy texture and lightmap to tex.src/
* Copy texture and lightmap to tex.src/ - in most cases into a region specific sub-directory.
* add the snippet from "facade_24x19m.py" to textures/catalog.py
* Add the snippet generated by texGU.py and enhanced as described above (e.g. "facade_24x19m.py") to a *.py file in tex.src/
 
* If you're adding a roof, name your texture "roof_something.png" and append it by default to tex.src/roofs_default.py.
If you're adding a roof, name your texture "roof_something.png" and append it to the list of ''roofs'' (instead of ''facades'')
<syntaxhighlight lang="python">
roofs.append(Texture('tex.src/roof_something.png',
</syntaxhighlight>
 
See roof examples starting around line 400.<del>Note that also roofs need a lightmap.</del> They no longer need a LM.


Finally, run
Finally, run
671

edits

Navigation menu