Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Georg Vollnhals schrieb: Sebastian Bechtold schrieb: .. If possible, I'd like to try to do this without doing such further changes. I'd like to avoid a plan where one feature requires another, and this one requires another again, and so on. The more you change, the higher is the risk of unplanned side effects and work to adapt other things to the changes. As I've already said: For myself, some kind of golden rule here is to change as little of the existing concepts and code as possible. This may rise problems which require some odd and maybe suboptimal solutions, but I think that's still better than running into a situation where the list of things which have to be changed is growing longer and longer. ... Hi Sebastian, once again my suggestion would be in accordance to your point of view a) to _minimize all changes to the actual given code _b) doing all work and calculation *off* runtime . Then it should be possible to 1. have the lat/lon coordinates calculated for all 4 corners of the used _new texture_ of any size 2. calculate the lat/lon coordinates of every corner of every _triangle_ out of the *.btg file and sort the tiles (the fileformat is sure documented anywhere, I looked for it but did not find any documentation) I hope/think that I don't have to care about the .btg file format. I would like to plug my stuff into the code somewhere downstream from the point where the terrain is loaded from the .btg file, and ignore how and from where it is loaded. When the triangles are instantiated in the scene graph, it must be possible to get the world coordinates of their vertices and apply the textures based on this information. 3. split the new texture into the sizes of all given triangles using the precalculated triangles area/lat-lat-corners Well, no. You wouldn't split up the textures. First, it's not possible (as far as I know, textures are always rectangular, I have never heard of triangular textures. Correct me if I'm wrong). Second, there's no reason to do so. You simply work with big textures that cover many triangles, and you do this by telling your 3D engine which area of the big texture should be mapped onto which triangle. This is not specific to my plan, it's the standard solution (I'm pretty sure you know this from Blender). 3.a uncomplicated for all triangles fully located within the new texture area = only new texture is used 3.b more problematic for boarder triangles only partly located within the new texture area = merging of old ground texture for the outside part and new texture for the inside part has to be done. This would be one theoretically possible solution to handle the irregular triangulation problem (see the conversation with Harald Johnsen). Practically, I think it would be very complicated. In my concept, the texture generation process knows nothing about the underlying and surrounding triangulation and texturing of the terrain at the place where a certain texture tile will be mapped. So you don't know when, where and how you'd have to do this texture merging. The two methods discussed with Harald Johnsen are probably better ways to go. 4. this results in a special ground-texture for every given triangle 5. there must be already a marker in the actual *.btg format for every ground-triangle which ground-texture to use. But there is only a limited number of ground-textures and therefore the marker might not have the data-format for a *big* number of different ground-textures (what would be necessary if we split bigger textures and create a lot of different new ground-textures). So a slight change of the *.btg format might be necessary. 6. With this the actual display-routines for OSG and PLIB should work principally, only the new *.btg data-format (for the really bigger number of available ground-textures) must be handled Well, as explained above and also noticed by yourself here: There's no one triangle - one texture-association, and we don't need or want it. You can happily forget points 4 to 6 :). _I know, this solution is suboptimal but can be made with a overviewable amount of coding_ (and therefore the chance to have very little negative sideeffects) but makes a big ground-texture improvement possible. And I know that this can really get more complicated if the new ground-texture-area uses partly 2 or more *.btg files. As far as I know, each .btg file contains a number of complete tiles, and the border of a scenery described in one .btg files consists of the borders of the tiles in the border area. When we map one texture on one tile (or several textures on one tile, but no texture across several tiles), there should be no problem here. Once working pretty well, this changes could be improved more and more in little further steps - that is what everyone likes to avoid big coding-problems. Some years ago I did this for X-Plane with own new groundtextures
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Sebastian Bechtold schrieb: Georg Vollnhals schrieb: ... Second, if we save these auto-generated textures on the hard disk (what should generally be a good idea for performance reasons), you could load them into an image manipulation program and add your own stuff or, for example, replace the auto-generated images with real aerial photos (if you have them and you're allowed to use them for FlightGear). In other words, you could paint anything anywhere. There are endless possibilities, if only the texture resolution is high enough. Ok, I'll wait and see :-) Almost everything will be better than the actual state. With best regards, Sebastian PS.: Did you try my patch? Well, I had a lot of workload at the end of last week as I worked some days from 7:00 am to sunset around 10:00 pm. So there was not so much time for FlightGear. Sometimes I am able to look at the forum or eMail, but I have no FG to do any work with (I only have a very old and poor performing laptop :-/ ). This whole weekend I am working on call (and just came back home) and if my mobile phone is quite for some hours I would like to compile and test your nice patch. Of course, I will give feedback to you, as I am really interested in this feature :-) Thank you once again for explaining me what you would like to do. Regards Georg - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to, the terrain mesh? (addressing especially Tim Moore)
Hello Sebastian! Sebastian Bechtold wrote: Tim Moore wrote: So, I don't mean to be discouraging because I think this is ultimately the right approach in terms of bumping up terrain detail and implementing terrain and texture LOD, but you have a lot of hacking ahead of you. Then it should be so. I'd really like to help making FlightGear better, and of course I want to improve the things which, in my option, need it most. Great to hear that you're so motivated. I hope it stays that way once you have started! ;-) I have to admit that at the moment, I have not the slightest idea about any coordinates and stuff, but I'm willed to learn :). Although I'm a bit skeptical about whether I like the concept at all or not, there's no better way of finding out than trying. ;-) I can assure you that I will provide support to you with everything I learned about scenery design, file formats and coordinate systems in the FlightGear world. I will not be able to assist you much in coding, and specifically not in the area of 3D programming, but I will try to do my very best to help you being successful in the areas I can help with. Sebastian Bechtold wrote: The plan would be to include the raw (meaning not compiled/digested into the .btg files) vector data into a scenery file and auto-generate the textures using this data. The .btg-file-format is not well extensible (and probably will not be needed anymore anyway with your approach), so I wouldn't integrate this data into the btg or stg files. You don't seem to be thinking about something like that anyway, so this is merely a note from my side. Cheers, Ralf - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Sebastian Bechtold wrote: Your thread title is misleading, Sorry, but I don't think so. The title describes my intentions pretty well. what you really want to do is to add layers, so to add some geometry drapped around the terrain. No, I don't I want to do that. I want to do what I've been talking about in my posting. Best regards, Sebastian Ok, I was reading a bit fast and saw rounded curve and you'll never get that with textures. The texture mapping we are using today is done with the function in simgear/texcoord.cxx. I supposed you've read the explanation of how it's done in msfs on the fsinsider site, the problem I see here is that we do not have a regular mesh grid so we will have the boundary triangles that will span on several textures. In msfs they have a regular grid (it's just a height map) so the mapping is direct. HJ. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to, the terrain mesh? (addressing especially Tim Moore)
Hi once more! Ralf Gerlich wrote: I can assure you that I will provide support to you with everything I learned about scenery design, file formats and coordinate systems in the FlightGear world. I will not be able to assist you much in coding, and specifically not in the area of 3D programming, but I will try to do my very best to help you being successful in the areas I can help with. So why not start right now? (forgive me if you already know a lot of the following). So what we have in the database is a logical setup of the terrain data in terms of polygons describing aerial features (forest, town, cities, etc.) in terms of polylines describing linear features (roads, railroads, small streams, etc.) Logical setup means that the data is not yet directly associated with a texture or in case of linear features also with a width, but this is typically done when extracting the data from the database and converting it to a TerraGear-friendly format in the TerraGear working directory. So the actual association of type of landcover and a texture is established by the script that does the conversion. Instead of converting the data to a TerraGear working directory it would be possible to convert it to a file format useable by your scenery engine, in which the polygons and lines would be associated with a display type defining texture and markings, and in case of the lines also with a width. The positions in the database are in WGS84 format, i.e. in geodesic coordinates according to the WGS84 ellipsoid approximation of the earth's surface. You can use the functions in simgear/math/SGGeodesy.hxx to convert these to cartesian coordinates. These functions are, however, a bit computationally expensive - at least when used hundreds or thousands of times per frame - so a pre-calculation of the actual cartesian coordinates used for display would be a good idea. The cartesian coordinates are used to actually model the earth as a round shape instead of a flat shape in display space, which makes things a lot easier (latitude-longitude wrap-around) and also more realistic (ever seen the curvature of the earth from high above?) The other data you will probably need is the elevation data. Most of the elevation data we have is from SRTM, the Shuttle Radar Topography Mission. The data consists of raster files in different formats, a non-standard format named HGT and as GeoTIFF. We can of course make this available in a suitable raw binary format. As I have some experience in working with all that data and the formats, I could write the conversion tools. We'd just have to agree on a format for the files. Cheers, Ralf - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Harald JOHNSEN schrieb: Sebastian Bechtold wrote: Your thread title is misleading, Sorry, but I don't think so. The title describes my intentions pretty well. what you really want to do is to add layers, so to add some geometry drapped around the terrain. No, I don't I want to do that. I want to do what I've been talking about in my posting. Best regards, Sebastian Ok, I was reading a bit fast and saw rounded curve and you'll never get that with textures. The texture mapping we are using today is done with the function in simgear/texcoord.cxx. I supposed you've read the explanation of how it's done in msfs on the fsinsider site, the problem I see here is that we do not have a regular mesh grid so we will have the boundary triangles that will span on several textures. In msfs they have a regular grid (it's just a height map) so the mapping is direct. Yes, that's true. This might really be something that makes the implementation a bit more complicated. Currently, I have two ideas to solve this problem: 1.) Apply the textures on tile-level. The tiles have a regular rectangular shape, so you could map one texture on one tile, without any overlapping. A problem with this could be the dimensions. You'd need quite large textures to get an acceptable low value of square-meters per pixel. I don't yet know enough about 3D programming to judge if this is feasible or not (hardware-limited maximum texture size, OSG / FlightGear performance with handling such huge textures and so on), but at least we could try it. 2.) Use smaller textures (for example 2x2 or 4x4 per tile) and draw overlapping redundant borders to their neighbor textures. Mhh...I have problems to write a good explaination of this in english...I mean...near the borders of each texture (for example a 100 Pixel wide frame), you draw exactly the same pixels as you draw on the corresponding frame of the neighbor texture in each direction. You would then apply the textures so that they overlap and decide with triangle in the border area is filled with which one of four adjacent textures. When the frames are wide enough to cover every irregular shape that could occur, it should be possible to handle the problem this way. A clear disadvantage of this approach is, of course, the additional graphics memory requirement, and it's perhaps a bit harder to implement. I don't know what's better or if there are other, better ways to solve this. Feel free to help finding a solution! :) Cheers, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (addressing especially Ralf)
Heiko Schulz schrieb: Hi, the graphic at the end of your steps should be no or very small problems. To make pseudo aerial photographs can be done very easy. Your idea sounds good now - but one curious question I have: when it really works at runtime, we could do something like the livery-changing for the textures? As an example, when we have rain - the runway will look wet? When it's snowing, the landscape will be white? I think this would involve basically the same things as it would now. You switch textures depending on specific environment properties. Shouldn't be that hard to do, no matter by which rules the textures are selected and applied. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Sebastian Bechtold wrote: Yes, that's true. This might really be something that makes the implementation a bit more complicated. Currently, I have two ideas to solve this problem: 1.) Apply the textures on tile-level. The tiles have a regular rectangular shape, so you could map one texture on one tile, without any overlapping. A problem with this could be the dimensions. You'd need quite large textures to get an acceptable low value of square-meters per pixel. I don't yet know enough about 3D programming to judge if this is feasible or not (hardware-limited maximum texture size, OSG / FlightGear performance with handling such huge textures and so on), but at least we could try it. 2.) Use smaller textures (for example 2x2 or 4x4 per tile) and draw overlapping redundant borders to their neighbor textures. Mhh...I have problems to write a good explaination of this in english...I mean...near the borders of each texture (for example a 100 Pixel wide frame), you draw exactly the same pixels as you draw on the corresponding frame of the neighbor texture in each direction. You would then apply the textures so that they overlap and decide with triangle in the border area is filled with which one of four adjacent textures. When the frames are wide enough to cover every irregular shape that could occur, it should be possible to handle the problem this way. A clear disadvantage of this approach is, of course, the additional graphics memory requirement, and it's perhaps a bit harder to implement. I don't know what's better or if there are other, better ways to solve this. Feel free to help finding a solution! :) Cheers, Sebastian The point 1) will give worse ground texture than today if we set the texture size at 4090^2. The point 2) is better except that this 100 pixel border is arbitrary. Sometimes it will be ok but i'm afraid there is some triangles that will go very far inside adjacent texture (some sea triangles inside the bay are very long for example). But if the the real problem is those anoying triangle why not simply delete them ? Frankly we don't care about the geometry in the btg file, we just need a height field, let just built this grid and voila (this is for the display, the btg is still used for agl computation, intersection, etc or not because finding a height in a grid is instant, no more sequential scan of a soup of triangles). HJ. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Hi! Harald JOHNSEN wrote: The point 1) will give worse ground texture than today if we set the texture size at 4090^2. Not necessarily. Currently we have the same basic texture resolution everywhere. With the approach Sebastian wants to try one could use tiles of different sizes depending on the distance from the viewer. Which may or may not be a good thing but we won't know until somebody tries. The point 2) is better except that this 100 pixel border is arbitrary. Sometimes it will be ok but i'm afraid there is some triangles that will go very far inside adjacent texture (some sea triangles inside the bay are very long for example). There won't be triangles oriented along the bay. If I understood Stefan right, there will be a regular triangle grid depicting the elevation structure and the borders between different regions will be depicted by a change in the master texture. But if the the real problem is those anoying triangle why not simply delete them ? Frankly we don't care about the geometry in the btg file, we just need a height field, let just built this grid and voila (this is for the display, the btg is still used for agl computation, intersection, etc or not because finding a height in a grid is instant, no more sequential scan of a soup of triangles). Exactly. The question that comes to mind is whether OpenSceneGraph does not already have support for such a thing. The applications of OSG I have seen seem all to use this concept so maybe it is reasonable to believe s.th. like that has been included in OSG? Mathias? As I said I'm skeptical about the outcome, but I would say it's worth a try. Sebastian seems to be committed, so why not? Cheers, Ralf - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ralf Gerlich wrote: Hi! Harald JOHNSEN wrote: But if the the real problem is those anoying triangle why not simply delete them ? Frankly we don't care about the geometry in the btg file, we just need a height field, let just built this grid and voila (this is for the display, the btg is still used for agl computation, intersection, etc or not because finding a height in a grid is instant, no more sequential scan of a soup of triangles). Exactly. The question that comes to mind is whether OpenSceneGraph does not already have support for such a thing. The applications of OSG I have seen seem all to use this concept so maybe it is reasonable to believe s.th. like that has been included in OSG? Mathias? OSG has primitive support for rendering heightfields, but it has good support for producing geocentric (even whole earth), paged databases with overlay textures and Level-Of-Detail from DEMs... the same sources that FlightGear uses. The polygons are not a grid but a TIN. So if you really want to depart from the btg format, there you go. See http://www.openscenegraph.com/projects/VirtualPlanetBuilder. I don't think this scheme is the best possible, and you'd still need to support the surface properties somehow, but it gets a lot of use from the OSG community. Tim -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFGjk6deDhWHdXrDRURAqLJAJ9IUCqQ6ADdPsPsPIeKVKI59PxakACdGXbZ qFb72DUrZlT2XdWj/HjXIb0= =MkkV -END PGP SIGNATURE- - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Harald JOHNSEN schrieb: Sebastian Bechtold wrote: Yes, that's true. This might really be something that makes the implementation a bit more complicated. Currently, I have two ideas to solve this problem: 1.) Apply the textures on tile-level. The tiles have a regular rectangular shape, so you could map one texture on one tile, without any overlapping. A problem with this could be the dimensions. You'd need quite large textures to get an acceptable low value of square-meters per pixel. I don't yet know enough about 3D programming to judge if this is feasible or not (hardware-limited maximum texture size, OSG / FlightGear performance with handling such huge textures and so on), but at least we could try it. 2.) Use smaller textures (for example 2x2 or 4x4 per tile) and draw overlapping redundant borders to their neighbor textures. Mhh...I have problems to write a good explaination of this in english...I mean...near the borders of each texture (for example a 100 Pixel wide frame), you draw exactly the same pixels as you draw on the corresponding frame of the neighbor texture in each direction. You would then apply the textures so that they overlap and decide with triangle in the border area is filled with which one of four adjacent textures. When the frames are wide enough to cover every irregular shape that could occur, it should be possible to handle the problem this way. A clear disadvantage of this approach is, of course, the additional graphics memory requirement, and it's perhaps a bit harder to implement. I don't know what's better or if there are other, better ways to solve this. Feel free to help finding a solution! :) Cheers, Sebastian The point 1) will give worse ground texture than today if we set the texture size at 4090^2. The point 2) is better except that this 100 pixel border is arbitrary. Sometimes it will be ok but i'm afraid there is some triangles that will go very far inside adjacent texture (some sea triangles inside the bay are very long for example). But if the the real problem is those anoying triangle why not simply delete them ? Frankly we don't care about the geometry in the btg file, we just need a height field, let just built this grid and voila (this is for the display, the btg is still used for agl computation, intersection, etc or not because finding a height in a grid is instant, no more sequential scan of a soup of triangles). Mh...I have to admit that I can't completely follow your words here. You talk about deleting the problematic triangles. Do you mean deleting at runtime or by rebuilding the scenery file? If possible, I'd like to try to do this without doing such further changes. I'd like to avoid a plan where one feature requires another, and this one requires another again, and so on. The more you change, the higher is the risk of unplanned side effects and work to adapt other things to the changes. As I've already said: For myself, some kind of golden rule here is to change as little of the existing concepts and code as possible. This may rise problems which require some odd and maybe suboptimal solutions, but I think that's still better than running into a situation where the list of things which have to be changed is growing longer and longer. Not to mention the inacceptable problems related to project coordination and the different opinions everyone has. I also think that the ground texture resolution you'd get with one big texture per tile won't be that good. Especially not when your original intention to do this was to make things like road markings(!) possible. In the end, the ground might look worse than before. But anyway - I'm convinced that this is in principle an important feature which opens the door to a lot of visual improvements, given that texture resolution and performance are fine. So I think it's absolutely worth working on it. If the first version won't pay off, there will surely be ways to improve it. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (especially addressing Harald Johnsen)
Sebastian Bechtold schrieb: .. If possible, I'd like to try to do this without doing such further changes. I'd like to avoid a plan where one feature requires another, and this one requires another again, and so on. The more you change, the higher is the risk of unplanned side effects and work to adapt other things to the changes. As I've already said: For myself, some kind of golden rule here is to change as little of the existing concepts and code as possible. This may rise problems which require some odd and maybe suboptimal solutions, but I think that's still better than running into a situation where the list of things which have to be changed is growing longer and longer. ... Hi Sebastian, once again my suggestion would be in accordance to your point of view a) to _minimize all changes to the actual given code _b) doing all work and calculation *off* runtime . Then it should be possible to 1. have the lat/lon coordinates calculated for all 4 corners of the used _new texture_ of any size 2. calculate the lat/lon coordinates of every corner of every _triangle_ out of the *.btg file and sort the tiles (the fileformat is sure documented anywhere, I looked for it but did not find any documentation) 3. split the new texture into the sizes of all given triangles using the precalculated triangles area/lat-lat-corners 3.a uncomplicated for all triangles fully located within the new texture area = only new texture is used 3.b more problematic for boarder triangles only partly located within the new texture area = merging of old ground texture for the outside part and new texture for the inside part has to be done. 4. this results in a special ground-texture for every given triangle 5. there must be already a marker in the actual *.btg format for every ground-triangle which ground-texture to use. But there is only a limited number of ground-textures and therefore the marker might not have the data-format for a *big* number of different ground-textures (what would be necessary if we split bigger textures and create a lot of different new ground-textures). So a slight change of the *.btg format might be necessary. 6. With this the actual display-routines for OSG and PLIB should work principally, only the new *.btg data-format (for the really bigger number of available ground-textures) must be handled _I know, this solution is suboptimal but can be made with a overviewable amount of coding_ (and therefore the chance to have very little negative sideeffects) but makes a big ground-texture improvement possible. And I know that this can really get more complicated if the new ground-texture-area uses partly 2 or more *.btg files. Once working pretty well, this changes could be improved more and more in little further steps - that is what everyone likes to avoid big coding-problems. Some years ago I did this for X-Plane with own new groundtextures from Landsat 7 . This was a lot easier as a) the used data-format was well documented b) there where only little squares with regular size to split the big texture to (very easy to handle, OLD X-Plane elevation data format, has changed since then). But I think it was _generally_ the same process to improve the ground-view as I suggested from 1 to 6 and should therefore work for FlightGear as well. Just my thoughts :-) Regards Georg EDDW - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Hello Sebastian! Sebastian Bechtold wrote: [...] but my plan would, for example, make it possible to render markings onto them, or draw softly rounded curves. I'm specifically interested in the markings part (although I'm also curious at how you want to implement softly rounded curves without breaking the current concept of texture display). This might require information which is currently not in the scenery files, such as the actual position of the centerline and width of the linear features. The triangles don't represent this information anymore, however it is available from the scenery sources (e.g. the scenery database). In general, making this information available in a suitable format shouldn't be a technical problem (maybe one of available manpower for implementing the stuff required, but that only means that it may take longer). Another possibility - at least for simple roads - would be to add a centerline to the road texture and make TerraGear create an appropriate texture mapping similar to how it is done currently in genapts for the taxiways. Unfortunately, the part of TerraGear which creates the texture coordinates does not know anymore that the polygon it is currently operating on originally was a linear feature (blown up according to its width to a polygon). So this approach might require some reorganisation of the TerraGear architecture. Given that the current architecture is quite complex (mainly due to the fact that the task at hand is complex) I don't think this is feasible without risking to break anything to a larger extent. When we're discussing about runtime creation of textures we might also get into discussing blending of ground textures. In that case, we should keep in mind that in reality not all types of landcovers actually blend into each other. When flying overhead forest areas - especially dense forest - these typically do not blend with surrounding agricultural or greenland areas, at least not in civilised areas where man tends to create sharp corners by land usage. That's actually not related to this specific discussion, but I wanted to note that before I forget. Cheers, Ralf - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Your thread title is misleading, Sorry, but I don't think so. The title describes my intentions pretty well. what you really want to do is to add layers, so to add some geometry drapped around the terrain. No, I don't I want to do that. I want to do what I've been talking about in my posting. Best regards, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (addressing especially Ralf)
Message: 8 Date: Thu, 05 Jul 2007 17:12:49 +0200 From: Ralf Gerlich [EMAIL PROTECTED] Subject: Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? To: FlightGear developers discussions flightgear-devel@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Hello Sebastian! Sebastian Bechtold wrote: [...] but my plan would, for example, make it possible to render markings onto them, or draw softly rounded curves. I'm specifically interested in the markings part (although I'm also curious at how you want to implement softly rounded curves without breaking the current concept of texture display). I -want- to break the current concept of texture display. I don't want to break anything else, but I definitely want to break this. It's all about breaking this ;). I want to use large patches of texture which are applied to the ground mesh, completely ignoring the materials of the triangles. All I need is to place them correctly, so that a road which is drawn onto a texture file which represents a certain area in the world apperes at the correct place in the simulator. This might require information which is currently not in the scenery files, such as the actual position of the centerline and width of the linear features. The triangles don't represent this information anymore, however it is available from the scenery sources (e.g. the scenery database). In general, making this information available in a suitable format shouldn't be a technical problem (maybe one of available manpower for implementing the stuff required, but that only means that it may take longer). Exactly this is the idea. I have already talked with Martin about this off-list. The plan would be to include the raw (meaning not compiled/digested into the .btg files) vector data into a scenery file and auto-generate the textures using this data. Then you could achieve things like road markings and smooth curves with some more or less simple 2D graphics programming. But however - first, I have to realise this texture mapping stuff. Without that, all further thoughts about how to generate the textures are useless. Another possibility - at least for simple roads - would be to add a centerline to the road texture and make TerraGear create an appropriate texture mapping similar to how it is done currently in genapts for the taxiways. Unfortunately, the part of TerraGear which creates the texture coordinates does not know anymore that the polygon it is currently operating on originally was a linear feature (blown up according to its width to a polygon). So this approach might require some reorganisation of the TerraGear architecture. Given that the current architecture is quite complex (mainly due to the fact that the task at hand is complex) I don't think this is feasible without risking to break anything to a larger extent. That's one reason why I don't want to touch terragear. The second is that I would like to make it possible to modify the ground textures without having to regenerate the scenery. When we're discussing about runtime creation of textures we might also get into discussing blending of ground textures. In that case, we should keep in mind that in reality not all types of landcovers actually blend into each other. When flying overhead forest areas - especially dense forest - these typically do not blend with surrounding agricultural or greenland areas, at least not in civilised areas where man tends to create sharp corners by land usage. That's actually not related to this specific discussion, but I wanted to note that before I forget. Yeah, I know. But well, that's more an artistic question, not so much a technical one. And as said by you (and also by me above), it's not related to this first step of the plan. But anyway, you are surely right. I have quite a number of thoughts about how to create realistic looking pseudo aerial photographs. If I should ever be successful with step 1, I'll come back to you with these. Cheers, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (addressing especially Ralf)
Hi, the graphic at the end of your steps should be no or very small problems. To make pseudo aerial photographs can be done very easy. Your idea sounds good now - but one curious question I have: when it really works at runtime, we could do something like the livery-changing for the textures? As an example, when we have rain - the runway will look wet? When it's snowing, the landscape will be white? Good luck HHS --- Sebastian Bechtold [EMAIL PROTECTED] schrieb: Message: 8 Date: Thu, 05 Jul 2007 17:12:49 +0200 From: Ralf Gerlich [EMAIL PROTECTED] Subject: Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? To: FlightGear developers discussions flightgear-devel@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Hello Sebastian! Sebastian Bechtold wrote: [...] but my plan would, for example, make it possible to render markings onto them, or draw softly rounded curves. I'm specifically interested in the markings part (although I'm also curious at how you want to implement softly rounded curves without breaking the current concept of texture display). I -want- to break the current concept of texture display. I don't want to break anything else, but I definitely want to break this. It's all about breaking this ;). I want to use large patches of texture which are applied to the ground mesh, completely ignoring the materials of the triangles. All I need is to place them correctly, so that a road which is drawn onto a texture file which represents a certain area in the world apperes at the correct place in the simulator. This might require information which is currently not in the scenery files, such as the actual position of the centerline and width of the linear features. The triangles don't represent this information anymore, however it is available from the scenery sources (e.g. the scenery database). In general, making this information available in a suitable format shouldn't be a technical problem (maybe one of available manpower for implementing the stuff required, but that only means that it may take longer). Exactly this is the idea. I have already talked with Martin about this off-list. The plan would be to include the raw (meaning not compiled/digested into the .btg files) vector data into a scenery file and auto-generate the textures using this data. Then you could achieve things like road markings and smooth curves with some more or less simple 2D graphics programming. But however - first, I have to realise this texture mapping stuff. Without that, all further thoughts about how to generate the textures are useless. Another possibility - at least for simple roads - would be to add a centerline to the road texture and make TerraGear create an appropriate texture mapping similar to how it is done currently in genapts for the taxiways. Unfortunately, the part of TerraGear which creates the texture coordinates does not know anymore that the polygon it is currently operating on originally was a linear feature (blown up according to its width to a polygon). So this approach might require some reorganisation of the TerraGear architecture. Given that the current architecture is quite complex (mainly due to the fact that the task at hand is complex) I don't think this is feasible without risking to break anything to a larger extent. That's one reason why I don't want to touch terragear. The second is that I would like to make it possible to modify the ground textures without having to regenerate the scenery. When we're discussing about runtime creation of textures we might also get into discussing blending of ground textures. In that case, we should keep in mind that in reality not all types of landcovers actually blend into each other. When flying overhead forest areas - especially dense forest - these typically do not blend with surrounding agricultural or greenland areas, at least not in civilised areas where man tends to create sharp corners by land usage. That's actually not related to this specific discussion, but I wanted to note that before I forget. Yeah, I know. But well, that's more an artistic question, not so much a technical one. And as said by you (and also by me above), it's not related to this first step of the plan. But anyway, you are surely right. I have quite a number of thoughts about how to create realistic looking pseudo aerial photographs. If I should ever be successful with step 1, I'll come back to you with these. Cheers, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click
Re: [Flightgear-devel] How to apply different texturing to, the terrain mesh? (addressing especially Tim Moore)
Tim Moore wrote: This is going to be messy; you're going to have to dive into the code of FlightGear, SimGear, and probably TerraGear too. The terrain mesh created by TerraGear has texture coordinates that are appropriate for the surface texture in each triangle. You're either going to have to generate alternate meshes -- with a more uniform texture coordinate scheme -- from TerraGear, or you're going to need to use OpenGL TexGen stuff to generate the appropriate texture coordinates at runtime. Remember that all the geometry is in earth-centric coordinates :) So, I don't mean to be discouraging because I think this is ultimately the right approach in terms of bumping up terrain detail and implementing terrain and texture LOD, but you have a lot of hacking ahead of you. Then it should be so. I'd really like to help making FlightGear better, and of course I want to improve the things which, in my option, need it most. Since this one is quite high on my list of ideas for improvements, and nobody else seems to work on it, I want to do it. Or at least try it. I believe you when you say that it is going to be complicated, but wouldn't it be boring if it wasn't ? I have to admit that at the moment, I have not the slightest idea about any coordinates and stuff, but I'm willed to learn :). (And well, maybe I shouldn't present myself as being so helpless with this. Ok, I'm completely new to the FlightGear source code and also to 3D programming, but I think I'm at least not the asolutely worst programmer in the world, I found that I can read and understand the FlightGear code a lot faster than I expected before, and I know how to use a few development tools to untangle it and get a picture of how everything works together. Again, I think this should be possible with some help from others.) Cheers, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh? (addressing especially Ralf)
Sebastian Bechtold schrieb: ... -want- to break the current concept of texture display. I don't want to break anything else, but I definitely want to break this. It's all about breaking this ;). I want to use large patches of texture which are applied to the ground mesh, completely ignoring the materials of the triangles. All I need is to place them correctly, so that a road which is drawn onto a texture file which represents a certain area in the world apperes at the correct place in the simulator. ... Cheers, Sebastian Hi all, Sebastian's plan to make the ground texturing independend from the mesh (triangles) seems to be a very good way to improve the FG scenery. If I understand it right, nothing would be changed from the actual state in those regions of the world where no special development has taken place, you just have the familiar standard ground textures. But in selected areas scenery designers could create special textures and they will be drawn elevation-mesh independent instead of the basic triangle associated textures. You could place whatever you like - improved FG basic textures, selfcreated ones or even photorealistic ones. We should have something like my good old Fly! II sim had implemented - an automatic texture converter where you give the lat/lon coordinates of ie all 4 corners (to avoid projection problems) of your custom texture and the process splits your texture into the right sub-sizes, ie fitting to the given mesh-triangle sizes - which would make the code-changes much easier as the display would use nearly the same routines as now. And the process should be able to create soft overlapping (merging) of the new and old regions (if wished). So this could be a pretty easy produre for pure users - create a groundtexture, small or big, run the programm with the right coordinates and get the result after some time plugged into the FG scenery system. And there should nearly no performance loss as the work is not done while running the sim - FG only has to watch where special regions are to be displayed. Just my thoughts about it, there might be a lot of more practicable solutions, but doing some improving work on ground textures display should be supported. Regards Georg EDDW - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Hi, Hmmm sounds like the flat textures which MSFS has... I like the way it is, because with the material you have some informations about bumbiness and so on... So much as I know, someone is working on the possibility to change the terrain easily ( I think Frederic Bouvier ) So I'm not sure about if this is a good idea... Greetings HHS --- Sebastian Bechtold [EMAIL PROTECTED] schrieb: Hello together. Now that I've found that the FlightGear source code does not have to be a book with seven seals for me and I was successfull with implementing my first, although small and simple, change to it, I got the idea to try a somewhat bigger modification to the program: I'd like to do some experiments with displaying ground features like roads, rivers and land usage completely through (automatically generated) textures instead of the current material/triangle-based approach. I think that drawing these features totally indepentent of the underlying triangulation has several great advantages, with the following two being the most important ones: - It would offer the possibility of drawing more details and generally more organic ground features than it would ever be possible with the triangle/materials approach with its inevitable hard edges and performance limitations (no way to render zillions of triangles for all the smallest details) - It would uncouple the processes of generating and drawing all the flat ground features from the processes of generating and displaying the terrain mesh. This would allow us to modify and extend the complexity of displayed flat ground stuff completely without having to edit or regenerate the terrain mesh. New roads or other things could easily be added by modifying a roads vector dataset and regenerate the responsible ground texture tiles (or even by painting the road onto them with a graphics program). I know and admit that this approach also may have some quite big disadvantages, primarily performance problems because of limited hardware resources, and of course the feared blurry ground at low altitudes effect. I have no idea if I will ever get this to work (with acceptable results), I have no idea if it will be better than the current solution (and even accepted as such by the community), but anyway - I would just like to try it. Just for my own fun and interest, if you don't like it. Now why I'm writing this sermon: It would be great if someone who has good knowledge of these parts of FlightGear which are critical for this experiment could support me with answers to some questions which will surely arise. This first one, to which the definition of the whole challenge can be reduced as for now, is nothing more or less than the following: How can I implement an override for the current way of how the terrain triangles are textured, which allows me to look at each single triangle, identified by the world coordinates of its corner vertices, and map a defined part of an arbitrary texture file onto it? Like saying, I have an image file which represents a certain part of the world with four corners at specific lat/lon coordinates, and now I want FlightGear to render this image onto the ground at exactly this place in the virtual world. I hope my explaination can be understood and I'm looking forward to some helpful replies :) With best regards, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel __ BE A BETTER FRAGESTELLER: Jetzt Frage stellen und einen von 44 iPods gewinnen! www.yahoo.de/clever - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Hi, But I forgot a wish: I would love to see, if we could change and do individuals paintings of the ground of airports - all the lines and markings. Maybe that could be something... Greetings HHS --- Sebastian Bechtold [EMAIL PROTECTED] schrieb: Hello together. Now that I've found that the FlightGear source code does not have to be a book with seven seals for me and I was successfull with implementing my first, although small and simple, change to it, I got the idea to try a somewhat bigger modification to the program: I'd like to do some experiments with displaying ground features like roads, rivers and land usage completely through (automatically generated) textures instead of the current material/triangle-based approach. I think that drawing these features totally indepentent of the underlying triangulation has several great advantages, with the following two being the most important ones: - It would offer the possibility of drawing more details and generally more organic ground features than it would ever be possible with the triangle/materials approach with its inevitable hard edges and performance limitations (no way to render zillions of triangles for all the smallest details) - It would uncouple the processes of generating and drawing all the flat ground features from the processes of generating and displaying the terrain mesh. This would allow us to modify and extend the complexity of displayed flat ground stuff completely without having to edit or regenerate the terrain mesh. New roads or other things could easily be added by modifying a roads vector dataset and regenerate the responsible ground texture tiles (or even by painting the road onto them with a graphics program). I know and admit that this approach also may have some quite big disadvantages, primarily performance problems because of limited hardware resources, and of course the feared blurry ground at low altitudes effect. I have no idea if I will ever get this to work (with acceptable results), I have no idea if it will be better than the current solution (and even accepted as such by the community), but anyway - I would just like to try it. Just for my own fun and interest, if you don't like it. Now why I'm writing this sermon: It would be great if someone who has good knowledge of these parts of FlightGear which are critical for this experiment could support me with answers to some questions which will surely arise. This first one, to which the definition of the whole challenge can be reduced as for now, is nothing more or less than the following: How can I implement an override for the current way of how the terrain triangles are textured, which allows me to look at each single triangle, identified by the world coordinates of its corner vertices, and map a defined part of an arbitrary texture file onto it? Like saying, I have an image file which represents a certain part of the world with four corners at specific lat/lon coordinates, and now I want FlightGear to render this image onto the ground at exactly this place in the virtual world. I hope my explaination can be understood and I'm looking forward to some helpful replies :) With best regards, Sebastian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel __ Wissenswertes für Bastler und Hobby Handwerker. BE A BETTER HEIMWERKER! www.yahoo.de/clever - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] How to apply different texturing to the terrain mesh?
Am Mittwoch 04 Juli 2007 19:38 schrieb Heiko Schulz: Hi, But I forgot a wish: I would love to see, if we could change and do individuals paintings of the ground of airports - all the lines and markings. Maybe that could be something... AFAIK Ralf Gerlich has done some research in that direction, as the new X-Plane apt.dat format codes this information. But he is totally overburdened with PhD, TaxiDraw, TerraGear, name some 10 projects more work... :-) Probably check back with him for more info. Also see the preliminary results at http://www.custom-scenery.org/ , especially http://www.custom-scenery.org/Research-Deve.274.0.html Thomas -- PhD Student, Dept. Animal Physiology, HU Berlin Tel +49 30 2093 6173, Fax +49 30 2093 6375 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel