Board index FlightGear Development Canvas

Supporting color/symbol palettes?

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Supporting color/symbol palettes?

Postby Hooray » Wed Aug 15, 2012 5:30 pm

Referring to: ... 40#p164340


It might be a good idea to consider supporting some form of symbol lookup so that property inputs can be mapped to color palettes or symbols (possibly elements, canvas groups or even other canvas textures).

Just think about it:

  • a heightmap (EGPWS) is all about mapping terrain elevations to color palettes
  • a wxradar is all about mapping cloud "density/types" to color palettes
  • a terrain awareness system maps relative terrain altitudes to color palettes
  • a tcas maps relative altitudes of surrounding traffic to symbols/colors

Currently, this would need to be implemented in scripting space by manually mapping a certain input to a given output - typically, that would involve thousands of "pixels" to be "animated" via scripting - now, if the canvas system were to be extended to support a "palette mapping mode", certain inputs could be automatically mapped to a given range of outputs (colors or symbols) in C++ space - in other words, a "palette" could even be a new canvas mode, where an input (such as terrain elevation) is automatically converted to a symbol by using a palette and applying it.

Basically, a palette could be based on a canvas group, where each element can be individually selected by mapping it to a lookup key or "value range".

Maybe someone has a better idea?

The whole point is to make palette implementations in Nasal space unnecessary - so that a palette/symbol lookup only needs to be written to the property tree once, and is automatically applied to a canvas group.

Subject: Jabiru J-170 (DEVELOPMENT)

omega95 wrote:By the way, Fred can you give me an idea on how to use od_gauge to continuously render a camera view to texture? I don't really know much about it but then every says that Project Rembrandt involves continuous rendering to texture.

And, is there a way to get terrain as a view? I mean, sorta like changing the color based on terrain. Oh, and I'd also need to place my own texture on the terrain, instead of the materials textures..

So, that's not just using od_gauge, for a terrain view, I'd need to actually re-render the whole terrain with some extra stuff...

Here's a picture of the real thing..


So, I was thinking we have the basic terrain and have a checker box texture over it.


And then diffuse it according to this gradient based on altitude.


Any ideas? 8)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Posts: 11968
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest