Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

TerraGear support for transition polygons

From FlightGear wiki
Jump to: navigation, search
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
Note: This page features a currently unreleased feature.
See history for the latest developments.

The plan

While working on the 850 airport parser, I came across clipper. This library includes a good polygon expansion / shrinking routine. I want to experiment with generating transition polys between landclasses to smooth out the transitions.

First up, is the BTG_File_Format will need another top level object. or modification of existing objects in order to support more than one texture coordinate per vertex.


Transition polys 01.png

The idea is that the first texture cordinate is the same as the current one, mapping the landclass texture to the poly so they line up with the inner core (red part) The second set Is used to indicate the distance from the core. (0,0) says this vertex is right on the landclass edge. (1,1) says we are max distance away.


TODO: I'll need to talk with shader folks to see if we can just specify the single float number instead of the tc pair)


I'm pretty sure I want to expand the Index Types. I don't think I can increase the Material type, as this would collide with the effects work. Instead, multi-textures would still be defined in the material.xml, but per vertex attributes pertaining to the material could be added via the Index Types

So the problem now, is we would need a material type (or many material types) that is/are capable of handling transitions between many different type of landclasses. Terragear could generate the texture coordinates for the transition, and some type of identifier for the landclasses involved.