1
0
Fork 0

Run urban shader in lightmap-only mode when either random or OMS buildings are enabled

This commit is contained in:
Thorsten Renk 2017-02-23 10:13:22 +02:00
parent c1811dd481
commit e1dcd3f38c
5 changed files with 51 additions and 7 deletions

View file

@ -11,6 +11,9 @@
<random-buildings type="bool">
<use>/sim/rendering/random-buildings</use>
</random-buildings>
<osm-buildings type="bool">
<use>/sim/rendering/osm-buildings</use>
</osm-buildings>
<quality-level>
<use>/sim/rendering/shaders/urban</use>
</quality-level>
@ -346,6 +349,13 @@
<use>random-buildings</use>
</value>
</uniform>
<uniform>
<name>osm_buildings</name>
<type>bool</type>
<value type="bool">
<use>osm-buildings</use>
</value>
</uniform>
<!-- BEGIN fog include -->
<uniform>
<name>visibility</name>
@ -1378,6 +1388,13 @@
<use>random-buildings</use>
</value>
</uniform>
<uniform>
<name>osm_buildings</name>
<type>bool</type>
<value type="bool">
<use>osm-buildings</use>
</value>
</uniform>
</pass>
</technique>
@ -1584,6 +1601,13 @@
<use>random-buildings</use>
</value>
</uniform>
<uniform>
<name>osm_buildings</name>
<type>bool</type>
<value type="bool">
<use>osm-buildings</use>
</value>
</uniform>
</pass>
</technique>
<technique n="7">
@ -1753,6 +1777,13 @@
<use>random-buildings</use>
</value>
</uniform>
<uniform>
<name>osm_buildings</name>
<type>bool</type>
<value type="bool">
<use>osm-buildings</use>
</value>
</uniform>
</pass>
</technique>
<technique n="8">
@ -1971,6 +2002,13 @@
<use>random-buildings</use>
</value>
</uniform>
<uniform>
<name>osm_buildings</name>
<type>bool</type>
<value type="bool">
<use>osm-buildings</use>
</value>
</uniform>
<!-- BEGIN fog include -->
<uniform>
<name>visibility</name>

View file

@ -59,6 +59,7 @@ uniform float landing_light3_offset;
uniform vec3 night_color;
uniform bool random_buildings;
uniform bool osm_buildings;
uniform int cloud_shadow_flag;
uniform int use_searchlight;
@ -211,7 +212,7 @@ float ray_intersect_relief(vec2 dp, vec2 ds)
float ray_intersect(vec2 dp, vec2 ds)
{
if ( random_buildings )
if (( random_buildings ) || ( osm_buildings ))
return 0.0;
else if ( quality_level >= 4.0 )
return ray_intersect_QDM( dp, ds );
@ -226,7 +227,7 @@ void main (void)
}
float depthfactor = depth_factor;
if ( random_buildings )
if (( random_buildings ) || (osm_buildings))
depthfactor = 0.0;
float steepness_factor = 1.0 -smoothstep(0.85, 0.9, steepness);

View file

@ -32,6 +32,7 @@ uniform float quality_level;
uniform float snowlevel;
uniform vec3 night_color;
uniform bool random_buildings;
uniform bool osm_buildings;
const float scale = 1.0;
int linear_search_steps = 10;
@ -157,12 +158,12 @@ float ray_intersect_relief(vec2 dp, vec2 ds)
float ray_intersect(vec2 dp, vec2 ds)
{
if ( random_buildings )
return 0.0;
if (( random_buildings ) || (osm_buildings))
{return 0.0;}
else if ( quality_level >= 4.0 )
return ray_intersect_QDM( dp, ds );
{return ray_intersect_QDM( dp, ds );}
else
return ray_intersect_relief( dp, ds );
{return ray_intersect_relief( dp, ds );}
}
void main (void)
@ -172,7 +173,7 @@ void main (void)
}
float depthfactor = depth_factor;
if ( random_buildings ) depthfactor = 0.0;
if (( random_buildings ) || (osm_buildings)) {depthfactor = 0.0;}
vec3 normal = normalize(VNormal);
vec3 tangent = normalize(VTangent);

View file

@ -179,6 +179,7 @@ Started September 2000 by David Megginson, david@megginson.com
<random-vegetation-optimize type="bool" userarchive="y">false</random-vegetation-optimize>
<vegetation-density type="double" userarchive="y">1.0</vegetation-density>
<random-buildings type="bool" userarchive="y">false</random-buildings>
<osm-buildings type="bool" userarchive="y">false</osm-buildings>
<building-density type="double" userarchive="y">1.0</building-density>
<horizon-effect type="bool" userarchive="y">false</horizon-effect>
<point-sprites type="bool" userarchive="y">true</point-sprites>

View file

@ -344,16 +344,19 @@
var val = getprop("/sim/gui/dialogs/rendering/buildings");
if (val == "Disabled") {
setprop("/sim/rendering/random-buildings", 0);
setprop("/sim/rendering/osm-buildings", 0);
setScenerySuffix("Buildings", 0);
}
if (val == "Randomly Generated") {
setprop("/sim/rendering/random-buildings", 1);
setprop("/sim/rendering/osm-buildings", 0);
setScenerySuffix("Buildings", 0);
}
if (val == "OpenStreetMap Data") {
setprop("/sim/rendering/random-buildings", 0);
setprop("/sim/rendering/osm-buildings", 1);
setScenerySuffix("Buildings", 1);
}
</script>