Merge branch 'next' of https://git.code.sf.net/p/flightgear/fgdata into next
|
@ -400,6 +400,25 @@ See README.materials for details on configuring the random building parameters.
|
||||||
|
|
||||||
The referenced <filename> (in the example buildings.txt) contains lines of the form
|
The referenced <filename> (in the example buildings.txt) contains lines of the form
|
||||||
|
|
||||||
|
X Y Z R B W D H P S O F T
|
||||||
|
|
||||||
|
Where:
|
||||||
|
- X,Y,Z are the cartesian coordinates of the center of the front face. +X is East, +Y is North
|
||||||
|
- R is the building rotation in degrees centered on the middle of the front face.
|
||||||
|
- B is the building type [0, 1, 2] for SMALL, MEDIUM, LARGE
|
||||||
|
- W is the building width in meters
|
||||||
|
- D is the building depth in meters
|
||||||
|
- H is the building height in meters, excluding any pitched roof
|
||||||
|
- P is the pitch height in meters. 0 for a flat roof
|
||||||
|
- S is the roof shape (currently unused - all roofs are flat or gabled depending on pitch height) :
|
||||||
|
0=flat 1=skillion 2=gabled 3=half-hipped 4=hipped 5=pyramidal 6=gambled
|
||||||
|
7=mansard 8=dome 9=onion 10=round 11=saltbox
|
||||||
|
- O is the roof ridge orientation (currently unused, all roofs are assumed orthogonal) :
|
||||||
|
0 = parallel to the front face of the building
|
||||||
|
1 = orthogonal to the front face of the building
|
||||||
|
- F is the number of floors (integer)
|
||||||
|
- T is the texture index to use (integer). Buildings with the same T value will have the same texture assigned. There are 6 small, 6 medium and 4 large textures.
|
||||||
|
|
||||||
<x> <y> <z> <rot> <type>
|
<x> <y> <z> <rot> <type>
|
||||||
|
|
||||||
where :
|
where :
|
||||||
|
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 816 KiB |
|
@ -7,7 +7,7 @@
|
||||||
<type>2d</type>
|
<type>2d</type>
|
||||||
<image>Textures/buildings.png</image>
|
<image>Textures/buildings.png</image>
|
||||||
<filter>linear-mipmap-linear</filter>
|
<filter>linear-mipmap-linear</filter>
|
||||||
<wrap-s>clamp</wrap-s>
|
<wrap-s>repeat</wrap-s>
|
||||||
<wrap-t>clamp</wrap-t>
|
<wrap-t>clamp</wrap-t>
|
||||||
<internal-format>normalized</internal-format>
|
<internal-format>normalized</internal-format>
|
||||||
</texture>
|
</texture>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<image>Textures/buildings-normalmap_orig.png</image>
|
<image>Textures/buildings-normalmap_orig.png</image>
|
||||||
<type>2d</type>
|
<type>2d</type>
|
||||||
<filter>linear-mipmap-linear</filter>
|
<filter>linear-mipmap-linear</filter>
|
||||||
<wrap-s>clamp</wrap-s>
|
<wrap-s>repeat</wrap-s>
|
||||||
<wrap-t>clamp</wrap-t>
|
<wrap-t>clamp</wrap-t>
|
||||||
<internal-format>normalized</internal-format>
|
<internal-format>normalized</internal-format>
|
||||||
</texture>
|
</texture>
|
||||||
|
@ -63,6 +63,12 @@
|
||||||
<negative-z>Aircraft/Generic/Effects/CubeMaps/buildings/D.png</negative-z>
|
<negative-z>Aircraft/Generic/Effects/CubeMaps/buildings/D.png</negative-z>
|
||||||
</images>
|
</images>
|
||||||
</texture>
|
</texture>
|
||||||
|
<texture n="6">
|
||||||
|
<!-- instance information from shader -->
|
||||||
|
<type>2d</type>
|
||||||
|
<wrap-s>clamp</wrap-s>
|
||||||
|
<wrap-t>clamp</wrap-t>
|
||||||
|
</texture>
|
||||||
<!--Ambient correction -->
|
<!--Ambient correction -->
|
||||||
<ambient-correction type="float"> 0.0 </ambient-correction>
|
<ambient-correction type="float"> 0.0 </ambient-correction>
|
||||||
<dirt-enabled type="int"> 0 </dirt-enabled>
|
<dirt-enabled type="int"> 0 </dirt-enabled>
|
||||||
|
@ -197,6 +203,22 @@
|
||||||
<fragment-shader n="2">Shaders/hazes.frag</fragment-shader>
|
<fragment-shader n="2">Shaders/hazes.frag</fragment-shader>
|
||||||
<fragment-shader n="3">Shaders/secondary_lights.frag</fragment-shader>
|
<fragment-shader n="3">Shaders/secondary_lights.frag</fragment-shader>
|
||||||
<fragment-shader n="4">Shaders/filters-ALS.frag</fragment-shader>-->
|
<fragment-shader n="4">Shaders/filters-ALS.frag</fragment-shader>-->
|
||||||
|
<attribute>
|
||||||
|
<name>instancePosition</name>
|
||||||
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>instanceScaleRotate</name>
|
||||||
|
<index>11</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rotPitchTex0x</name>
|
||||||
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>tex0yTex1xTex1y</name>
|
||||||
|
<index>13</index>
|
||||||
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
|
@ -249,6 +271,17 @@
|
||||||
<use>texture[0]/internal-format</use>
|
<use>texture[0]/internal-format</use>
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
<texture-unit>
|
||||||
|
<unit>1</unit>
|
||||||
|
<image><use>texture[6]/image</use></image>
|
||||||
|
<type><use>texture[6]/type</use></type>
|
||||||
|
<filter><use>texture[6]/filter</use></filter>
|
||||||
|
<wrap-s><use>texture[6]/wrap-s</use></wrap-s>
|
||||||
|
<wrap-t><use>texture[6]/wrap-t</use></wrap-t>
|
||||||
|
<internal-format>
|
||||||
|
<use>texture[6]/internal-format</use>
|
||||||
|
</internal-format>
|
||||||
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<!--<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>-->
|
<!--<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>-->
|
||||||
<!--<vertex-shader n="1">Shaders/building-default.vert</vertex-shader>-->
|
<!--<vertex-shader n="1">Shaders/building-default.vert</vertex-shader>-->
|
||||||
|
@ -256,12 +289,33 @@
|
||||||
<fragment-shader>Shaders/trivial.frag</fragment-shader>
|
<fragment-shader>Shaders/trivial.frag</fragment-shader>
|
||||||
<!--<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<!--<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>-->
|
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>-->
|
||||||
|
<attribute>
|
||||||
|
<name>instancePosition</name>
|
||||||
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>instanceScaleRotate</name>
|
||||||
|
<index>11</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rotPitchTex0x</name>
|
||||||
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>tex0yTex1xTex1y</name>
|
||||||
|
<index>13</index>
|
||||||
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>texture</name>
|
<name>texture</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
<value type="int">0</value>
|
<value type="int">0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>dataBuffer</name>
|
||||||
|
<type>sampler-1d</type>
|
||||||
|
<value type="int">1</value>
|
||||||
|
</uniform>
|
||||||
<color-mask type="vec4d">0 0 0 0</color-mask>
|
<color-mask type="vec4d">0 0 0 0</color-mask>
|
||||||
</pass>
|
</pass>
|
||||||
<pass>
|
<pass>
|
||||||
|
@ -293,12 +347,39 @@
|
||||||
<use>texture[0]/internal-format</use>
|
<use>texture[0]/internal-format</use>
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
<texture-unit>
|
||||||
|
<unit>1</unit>
|
||||||
|
<image><use>texture[6]/image</use></image>
|
||||||
|
<type><use>texture[6]/type</use></type>
|
||||||
|
<filter><use>texture[6]/filter</use></filter>
|
||||||
|
<wrap-s><use>texture[6]/wrap-s</use></wrap-s>
|
||||||
|
<wrap-t><use>texture[6]/wrap-t</use></wrap-t>
|
||||||
|
<internal-format>
|
||||||
|
<use>texture[6]/internal-format</use>
|
||||||
|
</internal-format>
|
||||||
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/building-ALS.vert</vertex-shader>
|
<vertex-shader>Shaders/building-ALS.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/terrain-ALS-base.frag</fragment-shader>
|
<fragment-shader>Shaders/terrain-ALS-base.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/hazes.frag</fragment-shader>
|
<fragment-shader>Shaders/hazes.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/filters-ALS.frag</fragment-shader>
|
<fragment-shader>Shaders/filters-ALS.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/noise.frag</fragment-shader>
|
<fragment-shader>Shaders/noise.frag</fragment-shader>
|
||||||
|
<attribute>
|
||||||
|
<name>instancePosition</name>
|
||||||
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>instanceScaleRotate</name>
|
||||||
|
<index>11</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rotPitchTex0x</name>
|
||||||
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>tex0yTex1xTex1y</name>
|
||||||
|
<index>13</index>
|
||||||
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>visibility</name>
|
<name>visibility</name>
|
||||||
|
@ -360,6 +441,11 @@
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
<value type="int">0</value>
|
<value type="int">0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>dataBuffer</name>
|
||||||
|
<type>sampler-1d</type>
|
||||||
|
<value type="int">1</value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>colorMode</name>
|
<name>colorMode</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
|
@ -408,6 +494,22 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program n="0">
|
<program n="0">
|
||||||
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
||||||
|
<attribute>
|
||||||
|
<name>instancePosition</name>
|
||||||
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>instanceScaleRotate</name>
|
||||||
|
<index>11</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rotPitchTex0x</name>
|
||||||
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>tex0yTex1xTex1y</name>
|
||||||
|
<index>13</index>
|
||||||
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
|
@ -448,22 +550,22 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program n="0">
|
<program n="0">
|
||||||
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
||||||
</program>
|
<attribute>
|
||||||
</pass>
|
<name>instancePosition</name>
|
||||||
</technique>
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
<technique n="10">
|
<attribute>
|
||||||
<pass>
|
<name>instanceScaleRotate</name>
|
||||||
<program n="0">
|
<index>11</index>
|
||||||
<vertex-shader n="0">Shaders/building-deferred-gbuffer.vert</vertex-shader>
|
</attribute>
|
||||||
</program>
|
<attribute>
|
||||||
</pass>
|
<name>rotPitchTex0x</name>
|
||||||
</technique>
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
<technique n="11">
|
<attribute>
|
||||||
<pass>
|
<name>tex0yTex1xTex1y</name>
|
||||||
<program n="0">
|
<index>13</index>
|
||||||
<vertex-shader n="0">Shaders/building-default.vert</vertex-shader>
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
|
@ -543,6 +645,17 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
-->
|
-->
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
<texture-unit>
|
||||||
|
<unit>1</unit>
|
||||||
|
<image><use>texture[6]/image</use></image>
|
||||||
|
<type><use>texture[6]/type</use></type>
|
||||||
|
<filter><use>texture[6]/filter</use></filter>
|
||||||
|
<wrap-s><use>texture[6]/wrap-s</use></wrap-s>
|
||||||
|
<wrap-t><use>texture[6]/wrap-t</use></wrap-t>
|
||||||
|
<internal-format>
|
||||||
|
<use>texture[6]/internal-format</use>
|
||||||
|
</internal-format>
|
||||||
|
</texture-unit>
|
||||||
<vertex-program-two-side>
|
<vertex-program-two-side>
|
||||||
<use>vertex-program-two-side</use>
|
<use>vertex-program-two-side</use>
|
||||||
</vertex-program-two-side>
|
</vertex-program-two-side>
|
||||||
|
@ -551,6 +664,22 @@
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<!--fog include-->
|
<!--fog include-->
|
||||||
<fragment-shader n="1">Shaders/default.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/default.frag</fragment-shader>
|
||||||
|
<attribute>
|
||||||
|
<name>instancePosition</name>
|
||||||
|
<index>10</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>instanceScaleRotate</name>
|
||||||
|
<index>11</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rotPitchTex0x</name>
|
||||||
|
<index>12</index>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>tex0yTex1xTex1y</name>
|
||||||
|
<index>13</index>
|
||||||
|
</attribute>
|
||||||
</program>
|
</program>
|
||||||
<!-- BEGIN fog include -->
|
<!-- BEGIN fog include -->
|
||||||
<!--<uniform>
|
<!--<uniform>
|
||||||
|
@ -601,6 +730,11 @@
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
<value type="int">0</value>
|
<value type="int">0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>dataBuffer</name>
|
||||||
|
<type>sampler-1d</type>
|
||||||
|
<value type="int">1</value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>colorMode</name>
|
<name>colorMode</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
|
|
|
@ -703,16 +703,24 @@ var enable_widgets = func(node, name, enable = 1) {
|
||||||
# GUI theming
|
# GUI theming
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
var nextStyle = func {
|
var nextStyle = func(delta=1) {
|
||||||
var curr = getprop("/sim/gui/current-style");
|
var curr = getprop("/sim/gui/current-style");
|
||||||
var styles = props.globals.getNode("/sim/gui").getChildren("style");
|
var styles = props.globals.getNode("/sim/gui").getChildren("style");
|
||||||
forindex (var i; styles)
|
forindex (var i; styles)
|
||||||
if (styles[i].getIndex() == curr)
|
if (styles[i].getIndex() == curr)
|
||||||
break;
|
break;
|
||||||
if ((i += 1) >= size(styles))
|
i += delta;
|
||||||
|
if (i >= size(styles))
|
||||||
i = 0;
|
i = 0;
|
||||||
|
if (i < 0) {
|
||||||
|
i = size(styles) - 1;
|
||||||
|
}
|
||||||
setprop("/sim/gui/current-style", styles[i].getIndex());
|
setprop("/sim/gui/current-style", styles[i].getIndex());
|
||||||
fgcommand("gui-redraw");
|
fgcommand("gui-redraw");
|
||||||
|
popupTip(sprintf("GUI style %s: %s",
|
||||||
|
styles[i].getIndex(),
|
||||||
|
styles[i].getValue("name"),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -357,8 +357,7 @@ for (var i = 0; i < wsize; i=i+1) {
|
||||||
# gradually fade in the interpolation weight of newly added points to
|
# gradually fade in the interpolation weight of newly added points to
|
||||||
# avoid sudden jumps
|
# avoid sudden jumps
|
||||||
|
|
||||||
if (w.weight < 1.0) {w.weight = w.weight + 0.02;}
|
if (w.weight < 1.0) {w.weight = w.weight + 0.002;}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sum_wind[1] = sum_wind[1] /sum_norm;
|
sum_wind[1] = sum_wind[1] /sum_norm;
|
||||||
|
|
|
@ -183,27 +183,34 @@ var dialog = {
|
||||||
me.toggle_unit(); # set to imperial
|
me.toggle_unit(); # set to imperial
|
||||||
#
|
#
|
||||||
# "private"
|
# "private"
|
||||||
me.font = { name: getprop("/sim/gui/selected-style/fonts/mp-list/name") or "FIXED_8x13",
|
me.font = { name: getprop("/sim/gui/selected-style/fonts/mp-list/name"),
|
||||||
size: getprop("/sim/gui/selected-style/fonts/mp-list/size") or 20,
|
size: getprop("/sim/gui/selected-style/fonts/mp-list/size"),
|
||||||
slant: getprop("/sim/gui/selected-style/fonts/mp-list/slant") or 0,
|
slant: getprop("/sim/gui/selected-style/fonts/mp-list/slant"),
|
||||||
};
|
};
|
||||||
|
#printf('me.font is: %s', view.str(me.font));
|
||||||
|
if (me.font.name == nil) {
|
||||||
|
# We try to cope if no font is specified, so that we inherit
|
||||||
|
# whatever default there is.
|
||||||
|
printf("Failed to find font for Pilot List dialog");
|
||||||
|
me.font = nil;
|
||||||
|
}
|
||||||
|
|
||||||
me.header = ["view", " callsign", " model", func dialog.dist_hdr, func dialog.alt_hdr ~ " ", "", " brg", "chat", "ignore" ~ " ", " code", "ver", "airport", " set"];
|
me.header = ["view", " callsign", " model", func dialog.dist_hdr, func dialog.alt_hdr ~ " ", "", " brg", "chat", "ignore" ~ " ", " code", "ver", "airport", " set"];
|
||||||
me.columns = [
|
me.columns = [
|
||||||
{ type: "checkbox", legend: "", property: "view", halign: "right", "pref-height": 14, "pref-width": 14, callback: "multiplayer.view_select", argprop: "callsign", },
|
{ type: "checkbox", legend: "", property: "view", halign: "right", "pref-height": 14, "pref-width": 14, callback: "multiplayer.view_select", argprop: "callsign", },
|
||||||
{ type: "text", property: "callsign", format: " %s", label: "-----------", halign: "fill" , font: me.font },
|
{ type: "text", property: "callsign", format: " %s", label: "-----------", halign: "fill" },
|
||||||
{ type: "text", property: "model-short", format: " %s", label: "--------------", halign: "fill" , font: me.font },
|
{ type: "text", property: "model-short", format: " %s", label: "--------------", halign: "fill" },
|
||||||
{ type: "text", property: func dialog.dist_node, format:" %8.2f", label: "---------", halign: "right", font: me.font },
|
{ type: "text", property: func dialog.dist_node, format:" %8.2f", label: "---------", halign: "right" },
|
||||||
{ type: "text", property: func dialog.alt_node, format:" %7.0f", label: "---------", halign: "right", font: me.font },
|
{ type: "text", property: func dialog.alt_node, format:" %7.0f", label: "---------", halign: "right" },
|
||||||
{ type: "text", property: "ascent_descent", format: "%s", label: "-", halign: "right", font: me.font },
|
{ type: "text", property: "ascent_descent", format: "%s", label: "-", halign: "right" },
|
||||||
{ type: "text", property: "bearing-to", format: " %3.0f", label: "----", halign: "right", font: me.font },
|
{ type: "text", property: "bearing-to", format: " %3.0f", label: "----", halign: "right" },
|
||||||
{ type: "button", legend: "", halign: "right", callback: "multiplayer.compose_message", "pref-height": 14, "pref-width": 14 },
|
{ type: "button", legend: "", halign: "right", callback: "multiplayer.compose_message", "pref-height": 14, "pref-width": 14 },
|
||||||
{ type: "checkbox", property: "controls/invisible", callback: "multiplayer.dialog.toggle_ignore",
|
{ type: "checkbox", property: "controls/invisible", callback: "multiplayer.dialog.toggle_ignore",
|
||||||
argprop: "callsign", label: "---------", halign: "right", font: me.font },
|
argprop: "callsign", label: "---------", halign: "right" },
|
||||||
{ type: "text", property: "id-code", format: " %s", label: "-", halign: "fill" , font: me.font },
|
{ type: "text", property: "id-code", format: " %s", label: "-", halign: "fill" },
|
||||||
{ type: "text", property: "sim/multiplay/protocol-version", format: " %s", label: "--", halign: "fill" , font: me.font },
|
{ type: "text", property: "sim/multiplay/protocol-version", format: " %s", label: "--", halign: "fill" },
|
||||||
{ type: "text", property: "airport-id", format: "%s", label: "----", halign: "fill" , font: me.font },
|
{ type: "text", property: "airport-id", format: "%s", label: "----", halign: "fill" },
|
||||||
{ type: "text", property: "set-loaded", format: "%s", label: "----", halign: "fill" , font: me.font },
|
{ type: "text", property: "set-loaded", format: "%s", label: "----", halign: "fill" },
|
||||||
];
|
];
|
||||||
me.cs_warnings = {};
|
me.cs_warnings = {};
|
||||||
me.name = "who-is-online";
|
me.name = "who-is-online";
|
||||||
|
@ -224,7 +231,9 @@ var dialog = {
|
||||||
me.dialog = gui.dialog[me.name] = gui.Widget.new();
|
me.dialog = gui.dialog[me.name] = gui.Widget.new();
|
||||||
me.dialog.set("name", me.name);
|
me.dialog.set("name", me.name);
|
||||||
me.dialog.set("dialog-name", me.name);
|
me.dialog.set("dialog-name", me.name);
|
||||||
|
if (typeof(me.font) == 'hash' and contains(me.font, "name") and me.font.name != nil) {
|
||||||
me.dialog.set("font", me.font.name);
|
me.dialog.set("font", me.font.name);
|
||||||
|
}
|
||||||
if (me.x != nil)
|
if (me.x != nil)
|
||||||
me.dialog.set("x", me.x);
|
me.dialog.set("x", me.x);
|
||||||
if (me.y != nil)
|
if (me.y != nil)
|
||||||
|
@ -235,6 +244,15 @@ var dialog = {
|
||||||
|
|
||||||
me.dialog.setColor(me.bg[0], me.bg[1], me.bg[2], me.bg[3]);
|
me.dialog.setColor(me.bg[0], me.bg[1], me.bg[2], me.bg[3]);
|
||||||
|
|
||||||
|
# Sets out default foreground colour and also me.font if it is not nil.
|
||||||
|
#
|
||||||
|
set_default = func(w) {
|
||||||
|
w.setColor(me.fg[1][0], me.fg[1][1], me.fg[1][2], me.fg[1][3],);
|
||||||
|
if (me.font != nil) {
|
||||||
|
w.node.setValues({ "font": me.font});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var titlebar = me.dialog.addChild("group");
|
var titlebar = me.dialog.addChild("group");
|
||||||
titlebar.set("layout", "hbox");
|
titlebar.set("layout", "hbox");
|
||||||
|
|
||||||
|
@ -249,10 +267,13 @@ var dialog = {
|
||||||
w.setBinding("nasal", "multiplayer.dialog.toggle_unit(); multiplayer.dialog._redraw_()");
|
w.setBinding("nasal", "multiplayer.dialog.toggle_unit(); multiplayer.dialog._redraw_()");
|
||||||
|
|
||||||
titlebar.addChild("empty").set("stretch", 1);
|
titlebar.addChild("empty").set("stretch", 1);
|
||||||
titlebar.addChild("text").set("label", "Pilots: ");
|
var w = titlebar.addChild("text");
|
||||||
|
w.set("label", "Pilots: ");
|
||||||
|
set_default(w);
|
||||||
|
|
||||||
var p = titlebar.addChild("text");
|
var w = titlebar.addChild("text");
|
||||||
p.node.setValues({ label: "---", live: 1, format: "%d", property: "ai/models/num-players" });
|
set_default(w);
|
||||||
|
w.node.setValues({ label: "---", live: 1, format: "%d", property: "ai/models/num-players" });
|
||||||
titlebar.addChild("empty").set("stretch", 1);
|
titlebar.addChild("empty").set("stretch", 1);
|
||||||
|
|
||||||
var w = titlebar.addChild("button");
|
var w = titlebar.addChild("button");
|
||||||
|
@ -271,10 +292,9 @@ var dialog = {
|
||||||
var col = 0;
|
var col = 0;
|
||||||
foreach (var h; me.header) {
|
foreach (var h; me.header) {
|
||||||
var w = content.addChild("text");
|
var w = content.addChild("text");
|
||||||
w.node.setValues({ "font" : me.font});
|
|
||||||
|
|
||||||
var l = typeof(h) == "func" ? h() : h;
|
var l = typeof(h) == "func" ? h() : h;
|
||||||
w.node.setValues({ "label": l, "row": row, "col": col, halign: me.columns[col].halign });
|
w.node.setValues({ "label": l, "row": row, "col": col, halign: me.columns[col].halign });
|
||||||
|
set_default(w);
|
||||||
w = content.addChild("hrule");
|
w = content.addChild("hrule");
|
||||||
w.node.setValues({ "row": row + 1, "col": col });
|
w.node.setValues({ "row": row + 1, "col": col });
|
||||||
col += 1;
|
col += 1;
|
||||||
|
@ -289,21 +309,22 @@ var dialog = {
|
||||||
color = me.fg[1];
|
color = me.fg[1];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
print("no model installed; check fallback");
|
#print("no model installed; check fallback");
|
||||||
var fbn = mp.node.getNode("sim/model/fallback-model-index");
|
var fbn = mp.node.getNode("sim/model/fallback-model-index");
|
||||||
if (fbn != nil){
|
if (fbn != nil){
|
||||||
print(" ->> got fallback node =",fbn.getValue());
|
#print(" ->> got fallback node =",fbn.getValue());
|
||||||
if (fbn.getValue() > 0) {
|
if (fbn.getValue() > 0) {
|
||||||
color = me.fg[3];
|
color = me.fg[3];
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
print(" ->> no fallback node");
|
#print(" ->> no fallback node");
|
||||||
}
|
}
|
||||||
foreach (var column; me.columns) {
|
foreach (var column; me.columns) {
|
||||||
var w = nil;
|
var w = nil;
|
||||||
if (column.type == "button") {
|
if (column.type == "button") {
|
||||||
w = content.addChild("button");
|
w = content.addChild("button");
|
||||||
w.node.setValues(column);
|
w.node.setValues(column);
|
||||||
|
set_default(w);
|
||||||
w.setBinding("nasal", column.callback ~ "(\"" ~ mp.callsign ~ "\",);");
|
w.setBinding("nasal", column.callback ~ "(\"" ~ mp.callsign ~ "\",);");
|
||||||
w.node.setValues({ row: row, col: col});
|
w.node.setValues({ row: row, col: col});
|
||||||
} else {
|
} else {
|
||||||
|
@ -311,9 +332,11 @@ var dialog = {
|
||||||
if (column.type == "text") {
|
if (column.type == "text") {
|
||||||
w = content.addChild("text");
|
w = content.addChild("text");
|
||||||
w.node.setValues(column);
|
w.node.setValues(column);
|
||||||
|
set_default(w);
|
||||||
} elsif (column.type == "checkbox") {
|
} elsif (column.type == "checkbox") {
|
||||||
w = content.addChild("checkbox");
|
w = content.addChild("checkbox");
|
||||||
w.setBinding("nasal", column.callback ~ "(getprop(\"" ~ mp.root ~ "/" ~ column.argprop ~ "\"))");
|
w.setBinding("nasal", column.callback ~ "(getprop(\"" ~ mp.root ~ "/" ~ column.argprop ~ "\"))");
|
||||||
|
set_default(w);
|
||||||
}
|
}
|
||||||
w.node.setValues({ row: row, col: col, live: 1, property: mp.root ~ "/" ~ p });
|
w.node.setValues({ row: row, col: col, live: 1, property: mp.root ~ "/" ~ p });
|
||||||
}
|
}
|
||||||
|
|
146
Nasal/view.nas
|
@ -5,7 +5,9 @@
|
||||||
|
|
||||||
# ATTENTION:
|
# ATTENTION:
|
||||||
# /sim/current-view/view-number is in the range 0..viewCount, it is NOT
|
# /sim/current-view/view-number is in the range 0..viewCount, it is NOT
|
||||||
# the index used in aircraft XML files (e.g. <view n="100">)
|
# the index used in aircraft XML files (e.g. <view n="100">).
|
||||||
|
#
|
||||||
|
# For the latter, use /sim/current-view/view-number-raw.
|
||||||
|
|
||||||
# For debugging. Returns string containing description of <x>.
|
# For debugging. Returns string containing description of <x>.
|
||||||
#
|
#
|
||||||
|
@ -258,9 +260,9 @@ var manager = {
|
||||||
forindex (var i; viewnodes) {
|
forindex (var i; viewnodes) {
|
||||||
# Install this view, marking as multiplayer if appropriate.
|
# Install this view, marking as multiplayer if appropriate.
|
||||||
var multiplayer = 1;
|
var multiplayer = 1;
|
||||||
if (i==4 or i==6) {
|
if (0) {
|
||||||
# Fly-by and Tower Look From views do not currently
|
# Use this for views that do not work with multiplayer
|
||||||
# support multiplayer aircraft.
|
# aircraft.
|
||||||
multiplayer = 0;
|
multiplayer = 0;
|
||||||
}
|
}
|
||||||
var viewnode = viewnodes[i];
|
var viewnode = viewnodes[i];
|
||||||
|
@ -359,39 +361,105 @@ var manager = {
|
||||||
|
|
||||||
|
|
||||||
var fly_by_view_handler = {
|
var fly_by_view_handler = {
|
||||||
init : func {
|
|
||||||
me.latN = props.globals.getNode("/sim/viewer/latitude-deg", 1);
|
|
||||||
me.lonN = props.globals.getNode("/sim/viewer/longitude-deg", 1);
|
|
||||||
me.altN = props.globals.getNode("/sim/viewer/altitude-ft", 1);
|
|
||||||
me.vnN = props.globals.getNode("/velocities/speed-north-fps", 1);
|
|
||||||
me.veN = props.globals.getNode("/velocities/speed-east-fps", 1);
|
|
||||||
me.hdgN = props.globals.getNode("/orientation/heading-deg", 1);
|
|
||||||
|
|
||||||
|
init : func {
|
||||||
setlistener("/sim/signals/reinit", func(n) { n.getValue() or me.reset() });
|
setlistener("/sim/signals/reinit", func(n) { n.getValue() or me.reset() });
|
||||||
setlistener("/sim/crashed", func(n) { n.getValue() and me.reset() });
|
setlistener("/sim/crashed", func(n) { n.getValue() and me.reset() });
|
||||||
setlistener("/sim/freeze/replay-state", func {
|
setlistener("/sim/freeze/replay-state", func {
|
||||||
settimer(func { me.reset() }, 1); # time for replay to catch up
|
settimer(func { me.reset() }, 1); # time for replay to catch up
|
||||||
});
|
});
|
||||||
|
setlistener("/sim/current-view/multiplayer", func(n) { me.reset(); } );
|
||||||
|
|
||||||
me.reset();
|
me.reset();
|
||||||
},
|
},
|
||||||
|
|
||||||
start : func {
|
start : func {
|
||||||
me.reset();
|
me.reset();
|
||||||
},
|
},
|
||||||
reset: func {
|
|
||||||
me.chase = -getprop("/sim/chase-distance-m");
|
|
||||||
# me.course = me.hdgN.getValue();
|
|
||||||
var vn = me.vnN.getValue();
|
|
||||||
var ve = me.veN.getValue();
|
|
||||||
me.course = (0.5*math.pi - math.atan2(vn, ve))*R2D;
|
|
||||||
|
|
||||||
me.last = geo.aircraft_position();
|
# Sets me.root to node with path given by the value of property
|
||||||
me.setpos(1);
|
# /sim/view[6]/config/root (which will be /ai/models/multiplayer[N]
|
||||||
# me.dist = 20;
|
# where N is the index of the multiplayer aircraft]. Note that this
|
||||||
|
# node sometimes doesn't yet exist, in which case we return with
|
||||||
|
# me.root = nil.
|
||||||
|
#
|
||||||
|
_set_multiplayer_root: func() {
|
||||||
|
# Set me.root to /ai/models/multiplayer[.]
|
||||||
|
var root = getprop("/sim/view[6]/config/root"); # /ai/models/multiplayer[]
|
||||||
|
me.root = props.globals.getNode(root);
|
||||||
|
if (me.root == nil) {
|
||||||
|
#printf("root does not exist: %s", str(root));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
aircraft_position: func() {
|
||||||
|
if (me.multiplayer) {
|
||||||
|
me._set_multiplayer_root();
|
||||||
|
if (me.root == nil) {
|
||||||
|
return geo.Coord.new();
|
||||||
|
}
|
||||||
|
var lat = me.root.getValue("position/latitude-deg");
|
||||||
|
var lon = me.root.getValue("position/longitude-deg");
|
||||||
|
var alt = me.root.getValue("position/altitude-ft") * FT2M;
|
||||||
|
|
||||||
|
return geo.Coord.new().set_latlon(lat, lon, alt);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return geo.aircraft_position();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
reset: func {
|
||||||
|
me.multiplayer = getprop("/sim/current-view/multiplayer") or 0;
|
||||||
|
|
||||||
|
if (me.multiplayer) {
|
||||||
|
me._set_multiplayer_root();
|
||||||
|
if (me.root == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
me.chase = me.root.getValue("set/sim/chase-distance-m");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
me.chase = getprop("/sim/chase-distance-m");
|
||||||
|
}
|
||||||
|
if (me.chase == nil or me.chase == 0) me.chase = -25;
|
||||||
|
me.chase = -me.chase;
|
||||||
|
|
||||||
|
me.last = me.aircraft_position();
|
||||||
|
me.setpos(1);
|
||||||
|
},
|
||||||
|
|
||||||
setpos : func(force = 0) {
|
setpos : func(force = 0) {
|
||||||
var pos = geo.aircraft_position();
|
if (me.multiplayer) {
|
||||||
var vn = me.vnN.getValue();
|
me._set_multiplayer_root();
|
||||||
var ve = me.veN.getValue();
|
if (me.root == nil) {
|
||||||
|
return 1; # Ensure we get called back soon to try again.
|
||||||
|
}
|
||||||
|
# We would like to find the aircraft's actual velocity
|
||||||
|
# vector rather than heading, but it's not easily available
|
||||||
|
# as a property, so we use the aircraft heading and its
|
||||||
|
# forwards speed (uBody-fps).
|
||||||
|
#
|
||||||
|
# E.g. i think this may give biased viewpoint positions if
|
||||||
|
# aircraft is moving sideways due to wind.
|
||||||
|
#
|
||||||
|
var u = me.root.getValue("velocities/uBody-fps"); # forwards
|
||||||
|
#var v = me.root.getValue("velocities/vBody-fps"); # vertical
|
||||||
|
#var w = me.root.getValue("velocities/wBody-fps"); # lateral
|
||||||
|
|
||||||
|
var course = me.root.getValue("orientation/true-heading-deg");
|
||||||
|
var course_rad = course * math.pi / 180;
|
||||||
|
var vn = u * math.cos(course_rad);
|
||||||
|
var ve = u * -math.sin(course_rad);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var vn = getprop("/velocities/speed-north-fps");
|
||||||
|
var ve = getprop("/velocities/speed-east-fps");
|
||||||
|
var course = (0.5*math.pi - math.atan2(vn, ve))*R2D;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pos = me.aircraft_position();
|
||||||
|
|
||||||
var dist = 0.0;
|
var dist = 0.0;
|
||||||
if ( force ) {
|
if ( force ) {
|
||||||
|
@ -410,8 +478,6 @@ var fly_by_view_handler = {
|
||||||
return 1.13;
|
return 1.13;
|
||||||
|
|
||||||
# "predict" and remember next aircraft position
|
# "predict" and remember next aircraft position
|
||||||
# var course = me.hdgN.getValue();
|
|
||||||
var course = (0.5*math.pi - math.atan2(vn, ve))*R2D;
|
|
||||||
var delta_alt = (pos.alt() - me.last.alt()) * 0.5;
|
var delta_alt = (pos.alt() - me.last.alt()) * 0.5;
|
||||||
pos.apply_course_distance(course, dist * 0.8);
|
pos.apply_course_distance(course, dist * 0.8);
|
||||||
pos.set_alt(pos.alt() + delta_alt);
|
pos.set_alt(pos.alt() + delta_alt);
|
||||||
|
@ -419,7 +485,17 @@ var fly_by_view_handler = {
|
||||||
|
|
||||||
# apply random deviation
|
# apply random deviation
|
||||||
var radius = me.chase * (0.5 * rand() + 0.7);
|
var radius = me.chase * (0.5 * rand() + 0.7);
|
||||||
|
|
||||||
|
if (me.multiplayer) {
|
||||||
|
# AGL not available for multiplayer aircraft as a property,
|
||||||
|
# so we calculate it explicitly.
|
||||||
|
var gl = geo.elevation(pos.lat(), pos.lon());
|
||||||
|
if (gl == nil) gl = 0;
|
||||||
|
var agl = pos.alt() - gl;
|
||||||
|
}
|
||||||
|
else {
|
||||||
var agl = getprop("/position/altitude-agl-ft") * FT2M;
|
var agl = getprop("/position/altitude-agl-ft") * FT2M;
|
||||||
|
}
|
||||||
if (agl > me.chase)
|
if (agl > me.chase)
|
||||||
var angle = rand() * 2 * math.pi;
|
var angle = rand() * 2 * math.pi;
|
||||||
else
|
else
|
||||||
|
@ -445,11 +521,23 @@ var fly_by_view_handler = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# set new view point
|
# set new view point
|
||||||
me.latN.setValue(lat);
|
if (me.multiplayer) {
|
||||||
me.lonN.setValue(lon);
|
# flightgear:src/Viewer/view.cxx will
|
||||||
me.altN.setValue(alt * M2FT);
|
# expect to find viewing position in
|
||||||
|
# /ai/models/multiplayer[]/sim/viewer/latitude-deg etc.
|
||||||
|
#
|
||||||
|
me.root.setValue("sim/viewer/latitude-deg", lat);
|
||||||
|
me.root.setValue("sim/viewer/longitude-deg", lon);
|
||||||
|
me.root.setValue("sim/viewer/altitude-ft", alt * M2FT);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setprop("/sim/viewer/latitude-deg", lat);
|
||||||
|
setprop("/sim/viewer/longitude-deg", lon);
|
||||||
|
setprop("/sim/viewer/altitude-ft", alt * M2FT);
|
||||||
|
}
|
||||||
return 7.3;
|
return 7.3;
|
||||||
},
|
},
|
||||||
|
|
||||||
update : func {
|
update : func {
|
||||||
return me.setpos();
|
return me.setpos();
|
||||||
},
|
},
|
||||||
|
@ -530,8 +618,10 @@ var model_view_handler_class = {
|
||||||
setup: func(data) {
|
setup: func(data) {
|
||||||
if (data.root == '/') {
|
if (data.root == '/') {
|
||||||
var ident = '[' ~ data.callsign ~ ']';
|
var ident = '[' ~ data.callsign ~ ']';
|
||||||
|
setprop('/sim/current-view/multiplayer', 0);
|
||||||
} else {
|
} else {
|
||||||
var ident = '"' ~ data.callsign ~ '" (' ~ data.model ~ ')';
|
var ident = '"' ~ data.callsign ~ '" (' ~ data.model ~ ')';
|
||||||
|
setprop('/sim/current-view/multiplayer', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
me.current = data.callsign;
|
me.current = data.callsign;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// -*-C++-*-
|
// -*-C++-*-
|
||||||
#version 120
|
#version 120
|
||||||
|
#extension GL_EXT_draw_instanced : enable
|
||||||
|
|
||||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||||
//
|
//
|
||||||
|
@ -15,6 +16,11 @@
|
||||||
#define MODE_DIFFUSE 1
|
#define MODE_DIFFUSE 1
|
||||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||||
|
|
||||||
|
attribute vec3 instancePosition; // (x,y,z)
|
||||||
|
attribute vec3 instanceScaleRotate; // (width, depth, height)
|
||||||
|
attribute vec3 rotPitchTex0x; // (rotation, pitch height, texture x offset)
|
||||||
|
attribute vec3 tex0yTex1xTex1y; // (texture y offset, texture x gain, texture y gain)
|
||||||
|
|
||||||
// The constant term of the lighting equation that doesn't depend on
|
// The constant term of the lighting equation that doesn't depend on
|
||||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||||
// component is set to 1 for front, 0 for back in order to work around
|
// component is set to 1 for front, 0 for back in order to work around
|
||||||
|
@ -74,27 +80,46 @@ void main()
|
||||||
float scattering;
|
float scattering;
|
||||||
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
|
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
|
||||||
|
|
||||||
// this code is copied from default.vert
|
// Determine the rotation for the building.
|
||||||
|
float sr = sin(6.28 * rotPitchTex0x.x);
|
||||||
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
float cr = cos(6.28 * rotPitchTex0x.x);
|
||||||
// Determine the rotation for the building. The Color alpha value provides rotation information
|
|
||||||
float sr = sin(6.28 * gl_Color.a);
|
|
||||||
float cr = cos(6.28 * gl_Color.a);
|
|
||||||
|
|
||||||
|
// Adjust pitch of roof to the correct height.
|
||||||
|
// The top roof vertices are the only ones that have fractional z values (1.5),
|
||||||
|
// so we can use this to identify them and scale up any pitched roof vertex to
|
||||||
|
// the correct pitch (rotPitchTex0x.y * 2.0 because of the fractional z value),
|
||||||
|
// then scale down by the building height (instanceScaleRotate.z) because
|
||||||
|
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||||
vec3 position = gl_Vertex.xyz;
|
vec3 position = gl_Vertex.xyz;
|
||||||
|
position.z = position.z + fract(position.z) * 2.0 * rotPitchTex0x.y / instanceScaleRotate.z - fract(position.z);
|
||||||
|
position = position * instanceScaleRotate.xyz;
|
||||||
|
|
||||||
// Rotation of the building and movement into position
|
// Rotation of the building and movement into position
|
||||||
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
||||||
position = position + gl_Color.xyz;
|
position = position + instancePosition.xyz;
|
||||||
|
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
||||||
|
// Texture coordinates are stored as tex0 and tex1 across two attributes.
|
||||||
|
// tex0 contains the bottom leftmost point, and tex1 contains (w,h).
|
||||||
|
gl_TexCoord[0].x = sign(gl_MultiTexCoord0.x) * rotPitchTex0x.z + gl_MultiTexCoord0.x * tex0yTex1xTex1y.y;
|
||||||
|
gl_TexCoord[0].y = tex0yTex1xTex1y.x + gl_MultiTexCoord0.y * tex0yTex1xTex1y.z;
|
||||||
|
|
||||||
// Rotate the normal.
|
// Rotate the normal.
|
||||||
normal = gl_Normal;
|
normal = gl_Normal;
|
||||||
|
|
||||||
|
// The roof pieces have a normal of (+/-0.7, 0.0, 0.7)
|
||||||
|
// If the roof is flat, then we need to change it to (0,0,1).
|
||||||
|
// First term evaluates for normals without a +z component (all except roof)
|
||||||
|
// Second term evaluates for roof normals with a pitch
|
||||||
|
// Third term evaluates for flat roofs
|
||||||
|
normal = step(0.5, 1.0 - normal.z) * normal + step(0.5, normal.z) * clamp(rotPitchTex0x.y, 0.0, 1.0) * normal + step(0.5, normal.z) * (1.0 - clamp(rotPitchTex0x.y, 0.0, 1.0)) * vec3(0,0,1);
|
||||||
|
|
||||||
|
// Rotate the normal as per the building.
|
||||||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||||
normal = gl_NormalMatrix * normal;
|
normal = gl_NormalMatrix * normal;
|
||||||
|
|
||||||
|
|
||||||
vec4 ambient_color, diffuse_color;
|
vec4 ambient_color, diffuse_color;
|
||||||
if (colorMode == MODE_DIFFUSE) {
|
if (colorMode == MODE_DIFFUSE) {
|
||||||
diffuse_color = vec4(1.0,1.0,1.0,1.0);
|
diffuse_color = vec4(1.0,1.0,1.0,1.0);
|
||||||
|
@ -254,4 +279,3 @@ if (use_IR_vision)
|
||||||
gl_BackColor.rgb = constant_term.rgb;
|
gl_BackColor.rgb = constant_term.rgb;
|
||||||
//gl_FrontColor.a = mie_angle; gl_BackColor.a = mie_angle;
|
//gl_FrontColor.a = mie_angle; gl_BackColor.a = mie_angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,16 @@
|
||||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||||
// equivalent to osg::Material::DIFFUSE.
|
// equivalent to osg::Material::DIFFUSE.
|
||||||
#version 120
|
#version 120
|
||||||
|
#extension GL_EXT_draw_instanced : enable
|
||||||
#define MODE_OFF 0
|
#define MODE_OFF 0
|
||||||
#define MODE_DIFFUSE 1
|
#define MODE_DIFFUSE 1
|
||||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||||
|
|
||||||
|
attribute vec3 instancePosition; // (x,y,z)
|
||||||
|
attribute vec3 instanceScaleRotate; // (width, depth, height)
|
||||||
|
attribute vec3 rotPitchTex0x; // (rotation, pitch height, texture x offset)
|
||||||
|
attribute vec3 tex0yTex1xTex1y; // (texture y offset, texture x gain, texture y gain)
|
||||||
|
|
||||||
// The constant term of the lighting equation that doesn't depend on
|
// The constant term of the lighting equation that doesn't depend on
|
||||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||||
// component is set to 1 for front, 0 for back in order to work around
|
// component is set to 1 for front, 0 for back in order to work around
|
||||||
|
@ -29,24 +35,42 @@ uniform int colorMode;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
// Determine the rotation for the building.
|
||||||
|
float sr = sin(6.28 * rotPitchTex0x.x);
|
||||||
|
float cr = cos(6.28 * rotPitchTex0x.x);
|
||||||
|
|
||||||
// Determine the rotation for the building. The Color alpha value provides rotation information
|
// Adjust pitch of roof to the correct height.
|
||||||
float sr = sin(6.28 * gl_Color.a);
|
// The top roof vertices are the only ones that have fractional z values (1.5),
|
||||||
float cr = cos(6.28 * gl_Color.a);
|
// so we can use this to identify them and scale up any pitched roof vertex to
|
||||||
|
// the correct pitch (rotPitchTex0x.y * 2.0 because of the fractional z value),
|
||||||
|
// then scale down by the building height (instanceScaleRotate.z) because
|
||||||
|
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||||
vec3 position = gl_Vertex.xyz;
|
vec3 position = gl_Vertex.xyz;
|
||||||
|
position.z = position.z + fract(position.z) * 2.0 * rotPitchTex0x.y / instanceScaleRotate.z - fract(position.z);
|
||||||
|
position = position * instanceScaleRotate.xyz;
|
||||||
|
|
||||||
// Rotation of the building and movement into position
|
// Rotation of the building and movement into position
|
||||||
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
||||||
position = position + gl_Color.xyz;
|
position = position + instancePosition.xyz;
|
||||||
|
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
||||||
|
|
||||||
//gl_Position = ftransform();
|
// Texture coordinates are stored as tex0 and tex1 across two attributes.
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
// tex0 contains the bottom leftmost point, and tex1 contains (w,h).
|
||||||
|
gl_TexCoord[0].x = sign(gl_MultiTexCoord0.x) * rotPitchTex0x.z + gl_MultiTexCoord0.x * tex0yTex1xTex1y.y;
|
||||||
|
gl_TexCoord[0].y = tex0yTex1xTex1y.x + gl_MultiTexCoord0.y * tex0yTex1xTex1y.z;
|
||||||
|
|
||||||
// Rotate the normal.
|
// Rotate the normal.
|
||||||
normal = gl_Normal;
|
normal = gl_Normal;
|
||||||
|
|
||||||
|
// The roof pieces have a normal of (+/-0.7, 0.0, 0.7)
|
||||||
|
// If the roof is flat, then we need to change it to (0,0,1).
|
||||||
|
// First term evaluates for normals without a +z component (all except roof)
|
||||||
|
// Second term evaluates for roof normals with a pitch
|
||||||
|
// Third term evaluates for flat roofs
|
||||||
|
normal = step(0.5, 1.0 - normal.z) * normal + step(0.5, normal.z) * clamp(rotPitchTex0x.y, 0.0, 1.0) * normal + step(0.5, normal.z) * (1.0 - clamp(rotPitchTex0x.y, 0.0, 1.0)) * vec3(0,0,1);
|
||||||
|
|
||||||
|
// Rotate the normal as per the building.
|
||||||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||||
normal = gl_NormalMatrix * normal;
|
normal = gl_NormalMatrix * normal;
|
||||||
|
|
||||||
|
|
|
@ -3,24 +3,55 @@
|
||||||
// Author: Frederic Bouvier.
|
// Author: Frederic Bouvier.
|
||||||
//
|
//
|
||||||
#version 120
|
#version 120
|
||||||
|
#extension GL_EXT_draw_instanced : enable
|
||||||
|
|
||||||
|
attribute vec3 instancePosition; // (x,y,z)
|
||||||
|
attribute vec3 instanceScaleRotate; // (width, depth, height)
|
||||||
|
attribute vec3 rotPitchTex0x; // (rotation, pitch height, texture x offset)
|
||||||
|
attribute vec3 tex0yTex1xTex1y; // (texture y offset, texture x gain, texture y gain)
|
||||||
|
|
||||||
varying vec3 ecNormal;
|
varying vec3 ecNormal;
|
||||||
varying float alpha;
|
varying float alpha;
|
||||||
void main() {
|
|
||||||
// Determine the rotation for the building. The Color alpha value provides rotation information
|
|
||||||
float sr = sin(6.28 * gl_Color.a);
|
|
||||||
float cr = cos(6.28 * gl_Color.a);
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// Determine the rotation for the building.
|
||||||
|
float sr = sin(6.28 * rotPitchTex0x.x);
|
||||||
|
float cr = cos(6.28 * rotPitchTex0x.x);
|
||||||
|
|
||||||
|
// Adjust pitch of roof to the correct height.
|
||||||
|
// The top roof vertices are the only ones that have fractional z values (1.5),
|
||||||
|
// so we can use this to identify them and scale up any pitched roof vertex to
|
||||||
|
// the correct pitch (rotPitchTex0x.y * 2.0 because of the fractional z value),
|
||||||
|
// then scale down by the building height (instanceScaleRotate.z) because
|
||||||
|
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||||
vec3 position = gl_Vertex.xyz;
|
vec3 position = gl_Vertex.xyz;
|
||||||
|
position.z = position.z + fract(position.z) * 2.0 * rotPitchTex0x.y / instanceScaleRotate.z - fract(position.z);
|
||||||
|
position = position * instanceScaleRotate.xyz;
|
||||||
|
|
||||||
// Rotation of the building and movement into position
|
// Rotation of the building and movement into position
|
||||||
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
||||||
position = position + gl_Color.xyz;
|
position = position + instancePosition.xyz;
|
||||||
|
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
||||||
|
|
||||||
|
// Texture coordinates are stored as tex0 and tex1 across two attributes.
|
||||||
|
// tex0 contains the bottom leftmost point, and tex1 contains (w,h).
|
||||||
|
gl_TexCoord[0].x = sign(gl_MultiTexCoord0.x) * rotPitchTex0x.z + gl_MultiTexCoord0.x * tex0yTex1xTex1y.y;
|
||||||
|
gl_TexCoord[0].y = tex0yTex1xTex1y.x + gl_MultiTexCoord0.y * tex0yTex1xTex1y.z;
|
||||||
|
|
||||||
// Rotate the normal.
|
// Rotate the normal.
|
||||||
ecNormal = gl_Normal;
|
ecNormal = gl_Normal;
|
||||||
|
|
||||||
|
// The roof pieces have a normal of (+/-0.7, 0.0, 0.7)
|
||||||
|
// If the roof is flat, then we need to change it to (0,0,1).
|
||||||
|
// First term evaluates for normals without a +z component (all except roof)
|
||||||
|
// Second term evaluates for roof normals with a pitch
|
||||||
|
// Third term evaluates for flat roofs
|
||||||
|
ecNormal = step(0.5, 1.0 - ecNormal.z) * ecNormal +
|
||||||
|
step(0.5, ecNormal.z) * clamp(rotPitchTex0x.y, 0.0, 1.0) * ecNormal +
|
||||||
|
step(0.5, ecNormal.z) * (1.0 - clamp(rotPitchTex0x.y, 0.0, 1.0)) * vec3(0,0,1);
|
||||||
|
|
||||||
|
// Rotate the normal as per the building.
|
||||||
ecNormal.xy = vec2(dot(ecNormal.xy, vec2(cr, sr)), dot(ecNormal.xy, vec2(-sr, cr)));
|
ecNormal.xy = vec2(dot(ecNormal.xy, vec2(cr, sr)), dot(ecNormal.xy, vec2(-sr, cr)));
|
||||||
ecNormal = gl_NormalMatrix * ecNormal;
|
ecNormal = gl_NormalMatrix * ecNormal;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
|
attribute vec3 instancePosition; // (x,y,z)
|
||||||
|
attribute vec3 instanceScaleRotate; // (width, depth, height)
|
||||||
|
attribute vec3 rotPitchTex0x; // (rotation, pitch height, texture x offset)
|
||||||
|
attribute vec3 tex0yTex1xTex1y; // (texture y offset, texture x gain, texture y gain)
|
||||||
|
|
||||||
varying vec3 rawpos;
|
varying vec3 rawpos;
|
||||||
varying vec3 VNormal;
|
varying vec3 VNormal;
|
||||||
varying vec3 VTangent;
|
varying vec3 VTangent;
|
||||||
|
@ -48,21 +53,44 @@ void rotationMatrixH(in float sinRz, in float cosRz, out mat4 rotmat)
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
float sr = sin(6.28 * gl_Color.a);
|
// Determine the rotation for the building.
|
||||||
float cr = cos(6.28 * gl_Color.a);
|
float sr = sin(6.28 * rotPitchTex0x.x);
|
||||||
|
float cr = cos(6.28 * rotPitchTex0x.x);
|
||||||
|
|
||||||
|
// Adjust pitch of roof to the correct height.
|
||||||
|
// The top roof vertices are the only ones that have fractional z values (1.5),
|
||||||
|
// so we can use this to identify them and scale up any pitched roof vertex to
|
||||||
|
// the correct pitch (rotPitchTex0x.y * 2.0 because of the fractional z value),
|
||||||
|
// then scale down by the building height (instanceScaleRotate.z) because
|
||||||
|
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||||
rawpos = gl_Vertex.xyz;
|
rawpos = gl_Vertex.xyz;
|
||||||
|
rawpos.z = rawpos.z + fract(rawpos.z) * 2.0 * rotPitchTex0x.y / instanceScaleRotate.z - fract(rawpos.z);
|
||||||
|
rawpos = rawpos * instanceScaleRotate.xyz;
|
||||||
|
|
||||||
// Rotation of the object and movement into position
|
// Rotation of the building and movement into rawpos
|
||||||
rawpos.xy = vec2(dot(rawpos.xy, vec2(cr, sr)), dot(rawpos.xy, vec2(-sr, cr)));
|
rawpos.xy = vec2(dot(rawpos.xy, vec2(cr, sr)), dot(rawpos.xy, vec2(-sr, cr)));
|
||||||
rawpos = rawpos + gl_Color.xyz;
|
rawpos = rawpos + instancePosition.xyz;
|
||||||
|
vec4 ecPosition = gl_ModelViewMatrix * vec4(rawpos, 1.0);
|
||||||
|
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * vec4(rawpos.x, rawpos.y, rawpos.z, 1.0);
|
// Texture coordinates are stored as tex0 and tex1 across two attributes.
|
||||||
//fog_Func(fogType);
|
// tex0 contains the bottom leftmost point, and tex1 contains (w,h).
|
||||||
|
gl_TexCoord[0].x = sign(gl_MultiTexCoord0.x) * rotPitchTex0x.z + gl_MultiTexCoord0.x * tex0yTex1xTex1y.y;
|
||||||
|
gl_TexCoord[0].y = tex0yTex1xTex1y.x + gl_MultiTexCoord0.y * tex0yTex1xTex1y.z;
|
||||||
|
|
||||||
// Rotate the normal.
|
// Rotate the normal.
|
||||||
vec3 normal = gl_Normal;
|
vec3 normal = gl_Normal;
|
||||||
|
|
||||||
|
// The roof pieces have a normal of (+/-0.7, 0.0, 0.7)
|
||||||
|
// If the roof is flat, then we need to change it to (0,0,1).
|
||||||
|
// First term evaluates for normals without a +z component (all except roof)
|
||||||
|
// Second term evaluates for roof normals with a pitch
|
||||||
|
// Third term evaluates for flat roofs
|
||||||
|
normal = step(0.5, 1.0 - normal.z) * normal +
|
||||||
|
step(0.5, normal.z) * clamp(rotPitchTex0x.y, 0.0, 1.0) * normal +
|
||||||
|
step(0.5, normal.z) * (1.0 - clamp(rotPitchTex0x.y, 0.0, 1.0)) * vec3(0,0,1);
|
||||||
|
|
||||||
|
// Rotate the normal as per the building.
|
||||||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||||
//normal = gl_NormalMatrix * normal;
|
|
||||||
|
|
||||||
VNormal = normalize(gl_NormalMatrix * normal);
|
VNormal = normalize(gl_NormalMatrix * normal);
|
||||||
vec3 n = normalize(normal);
|
vec3 n = normalize(normal);
|
||||||
|
@ -126,5 +154,4 @@ void main(void)
|
||||||
gl_FrontColor = vec4(1.0,1.0,1.0,1.0);
|
gl_FrontColor = vec4(1.0,1.0,1.0,1.0);
|
||||||
}
|
}
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(rawpos,1.0);
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(rawpos,1.0);
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,41 +3,67 @@
|
||||||
// Licence: GPL v2
|
// Licence: GPL v2
|
||||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||||
#version 120
|
#version 120
|
||||||
|
#extension GL_EXT_draw_instanced : enable
|
||||||
|
|
||||||
varying vec4 diffuseColor;
|
varying vec4 diffuseColor;
|
||||||
varying vec3 VBinormal;
|
varying vec3 VBinormal;
|
||||||
varying vec3 VNormal;
|
varying vec3 VNormal;
|
||||||
varying vec3 VTangent;
|
varying vec3 VTangent;
|
||||||
varying vec3 rawpos;
|
|
||||||
varying vec3 eyeVec;
|
varying vec3 eyeVec;
|
||||||
|
varying vec3 normal;
|
||||||
|
|
||||||
uniform int refl_dynamic;
|
uniform int refl_dynamic;
|
||||||
uniform int nmap_enabled;
|
uniform int nmap_enabled;
|
||||||
uniform int shader_qual;
|
uniform int shader_qual;
|
||||||
uniform int rembrandt_enabled;
|
uniform int rembrandt_enabled;
|
||||||
|
|
||||||
|
attribute vec3 instancePosition; // (x,y,z)
|
||||||
|
attribute vec3 instanceScaleRotate; // (width, depth, height)
|
||||||
|
attribute vec3 rotPitchTex0x; // (rotation, pitch height, texture x offset)
|
||||||
|
attribute vec3 tex0yTex1xTex1y; // (texture y offset, texture x gain, texture y gain)
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
float sr = sin(6.28 * gl_Color.a);
|
// Determine the rotation for the building.
|
||||||
float cr = cos(6.28 * gl_Color.a);
|
float sr = sin(6.28 * rotPitchTex0x.x);
|
||||||
rawpos = gl_Vertex.xyz;
|
float cr = cos(6.28 * rotPitchTex0x.x);
|
||||||
|
|
||||||
// Rotation of the object and movement into position
|
// Adjust pitch of roof to the correct height.
|
||||||
rawpos.xy = vec2(dot(rawpos.xy, vec2(cr, sr)), dot(rawpos.xy, vec2(-sr, cr)));
|
// The top roof vertices are the only ones that have fractional z values (1.5),
|
||||||
rawpos = rawpos + gl_Color.xyz;
|
// so we can use this to identify them and scale up any pitched roof vertex to
|
||||||
|
// the correct pitch (rotPitchTex0x.y * 2.0 because of the fractional z value),
|
||||||
|
// then scale down by the building height (instanceScaleRotate.z) because
|
||||||
|
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||||
|
vec3 position = gl_Vertex.xyz;
|
||||||
|
position.z = position.z + fract(position.z) * 2.0 * rotPitchTex0x.y / instanceScaleRotate.z - fract(position.z);
|
||||||
|
position = position * instanceScaleRotate.xyz;
|
||||||
|
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * vec4(rawpos.xyz, 1.0);
|
// Rotation of the building and movement into position
|
||||||
|
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
||||||
|
position = position + instancePosition.xyz;
|
||||||
|
|
||||||
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
||||||
|
vec4 ecPosition = gl_ModelViewMatrix * vec4(position, 1.0);
|
||||||
|
|
||||||
eyeVec = ecPosition.xyz;
|
eyeVec = ecPosition.xyz;
|
||||||
|
|
||||||
// Rotate the normal.
|
// Rotate the normal.
|
||||||
vec3 normal = gl_Normal;
|
normal = gl_Normal;
|
||||||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
|
||||||
|
|
||||||
VNormal = normalize(gl_NormalMatrix * normal);
|
// The roof pieces have a normal of (+/-0.7, 0.0, 0.7)
|
||||||
|
// If the roof is flat, then we need to change it to (0,0,1).
|
||||||
|
// First term evaluates for normals without a +z component (all except roof)
|
||||||
|
// Second term evaluates for roof normals with a pitch
|
||||||
|
// Third term evaluates for flat roofs
|
||||||
|
normal = step(0.5, 1.0 - normal.z) * normal + step(0.5, normal.z) * clamp(rotPitchTex0x.y, 0.0, 1.0) * normal + step(0.5, normal.z) * (1.0 - clamp(rotPitchTex0x.y, 0.0, 1.0)) * vec3(0,0,1);
|
||||||
|
|
||||||
|
// Rotate the normal as per the building.
|
||||||
|
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||||
vec3 n = normalize(normal);
|
vec3 n = normalize(normal);
|
||||||
|
|
||||||
vec3 c1 = cross(n, vec3(0.0,0.0,1.0));
|
vec3 c1 = cross(n, vec3(0.0,0.0,1.0));
|
||||||
vec3 c2 = cross(n, vec3(0.0,1.0,0.0));
|
vec3 c2 = cross(n, vec3(0.0,1.0,0.0));
|
||||||
|
VNormal = normalize(gl_NormalMatrix * normal);
|
||||||
|
|
||||||
VTangent = c1;
|
VTangent = c1;
|
||||||
if(length(c2)>length(c1)){
|
if(length(c2)>length(c1)){
|
||||||
|
@ -49,8 +75,6 @@ void main(void)
|
||||||
VTangent = normalize(gl_NormalMatrix * -VTangent);
|
VTangent = normalize(gl_NormalMatrix * -VTangent);
|
||||||
VBinormal = normalize(gl_NormalMatrix * VBinormal);
|
VBinormal = normalize(gl_NormalMatrix * VBinormal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Force no alpha on random buildings
|
// Force no alpha on random buildings
|
||||||
diffuseColor = vec4(gl_FrontMaterial.diffuse.rgb,1.0);
|
diffuseColor = vec4(gl_FrontMaterial.diffuse.rgb,1.0);
|
||||||
|
|
||||||
|
@ -60,7 +84,10 @@ void main(void)
|
||||||
} else {
|
} else {
|
||||||
gl_FrontColor = vec4(1.0);
|
gl_FrontColor = vec4(1.0);
|
||||||
}
|
}
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(rawpos,1.0);
|
|
||||||
gl_ClipVertex = ecPosition;
|
gl_ClipVertex = ecPosition;
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
||||||
|
// Texture coordinates are stored as tex0 and tex1 across two attributes.
|
||||||
|
// tex0 contains the bottom leftmost point, and tex1 contains (w,h).
|
||||||
|
gl_TexCoord[0].x = sign(gl_MultiTexCoord0.x) * rotPitchTex0x.z + gl_MultiTexCoord0.x * tex0yTex1xTex1y.y;
|
||||||
|
gl_TexCoord[0].y = tex0yTex1xTex1y.x + gl_MultiTexCoord0.y * tex0yTex1xTex1y.z;
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 702 KiB After Width: | Height: | Size: 876 KiB |
Before Width: | Height: | Size: 722 KiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 381 KiB After Width: | Height: | Size: 323 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.4 MiB |
|
@ -8,7 +8,7 @@
|
||||||
"helvetica_bold.txf". "size" and "slant" take only effect on
|
"helvetica_bold.txf". "size" and "slant" take only effect on
|
||||||
texture fonts.
|
texture fonts.
|
||||||
-->
|
-->
|
||||||
<style-name>Anthrax</style-name>
|
<name>Anthrax</name>
|
||||||
<fonts>
|
<fonts>
|
||||||
<gui>
|
<gui>
|
||||||
<name type="string">HELVETICA_12</name>
|
<name type="string">HELVETICA_12</name>
|
||||||
|
|