Tentative fix for taxiway line z-fighting within ALS
This commit is contained in:
parent
dfb8073607
commit
77e5cc4c9f
5 changed files with 38 additions and 27 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
<name>Effects/lfeat</name>
|
<name>Effects/lfeat</name>
|
||||||
<inherits-from>Effects/terrain-default</inherits-from>
|
<inherits-from>Effects/runway</inherits-from>
|
||||||
<parameters>
|
<parameters>
|
||||||
<material>
|
<material>
|
||||||
<ambient type="vec4d">
|
<ambient type="vec4d">
|
||||||
|
@ -19,8 +19,15 @@
|
||||||
<shininess>1.2</shininess>
|
<shininess>1.2</shininess>
|
||||||
</material>
|
</material>
|
||||||
<transparent>true</transparent>
|
<transparent>true</transparent>
|
||||||
|
<raise_vertex type="bool">true</raise_vertex>
|
||||||
</parameters>
|
</parameters>
|
||||||
<technique n="1">
|
<technique n="1">
|
||||||
|
<predicate>
|
||||||
|
<equal>
|
||||||
|
<property>/sim/rendering/shaders/skydome</property>
|
||||||
|
<value type="bool" >false</value>
|
||||||
|
</equal>
|
||||||
|
</predicate>
|
||||||
<pass>
|
<pass>
|
||||||
<lighting>true</lighting>
|
<lighting>true</lighting>
|
||||||
<depth>
|
<depth>
|
||||||
|
|
|
@ -84,6 +84,7 @@
|
||||||
<moonlight><use>/environment/moonlight</use></moonlight>
|
<moonlight><use>/environment/moonlight</use></moonlight>
|
||||||
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
||||||
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
||||||
|
<raise_vertex type="bool">false</raise_vertex>
|
||||||
<!-- END fog include -->
|
<!-- END fog include -->
|
||||||
</parameters>
|
</parameters>
|
||||||
<generate>
|
<generate>
|
||||||
|
@ -526,6 +527,11 @@
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
<value><use>display_ysize</use></value>
|
<value><use>display_ysize</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>raise_vertex</name>
|
||||||
|
<type>bool</type>
|
||||||
|
<value> <use>raise_vertex</use></value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>texture</name>
|
<name>texture</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
@ -542,10 +548,14 @@
|
||||||
<value>2</value>
|
<value>2</value>
|
||||||
<!-- AMBIENT_AND_DIFFUSE -->
|
<!-- AMBIENT_AND_DIFFUSE -->
|
||||||
</uniform>
|
</uniform>
|
||||||
<depth>
|
<!--<depth>
|
||||||
<function>lequal</function>
|
<function>lequal</function>
|
||||||
<!-- <write-mask type="bool">false</write-mask> -->
|
<write-mask type="bool">false</write-mask>
|
||||||
</depth>
|
</depth>-->
|
||||||
|
<alpha-test>
|
||||||
|
<comparison>greater</comparison>
|
||||||
|
<reference type="float">0.4</reference>
|
||||||
|
</alpha-test>
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
<dot_size>1.0</dot_size>
|
<dot_size>1.0</dot_size>
|
||||||
<dust_resistance>1.0</dust_resistance>
|
<dust_resistance>1.0</dust_resistance>
|
||||||
<rock_strata>0</rock_strata>
|
<rock_strata>0</rock_strata>
|
||||||
|
<raise_vertex type="bool">false</raise_vertex>
|
||||||
<visibility><use>/environment/ground-visibility-m</use></visibility>
|
<visibility><use>/environment/ground-visibility-m</use></visibility>
|
||||||
<avisibility><use>/environment/visibility-m</use></avisibility>
|
<avisibility><use>/environment/visibility-m</use></avisibility>
|
||||||
<lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
|
<lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
|
||||||
|
@ -732,6 +733,11 @@
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
<value><use>rock_strata</use></value>
|
<value><use>rock_strata</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>raise_vertex</name>
|
||||||
|
<type>bool</type>
|
||||||
|
<value> <use>raise_vertex</use></value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>texture</name>
|
<name>texture</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
|
|
@ -176,23 +176,23 @@ float noise_2000m = Noise2D(rawPos.xy, 2000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const vec4 dust_color = vec4 (0.76, 0.71, 0.56, 1.0);
|
const vec3 dust_color = vec3 (0.76, 0.71, 0.56);
|
||||||
const vec4 lichen_color = vec4 (0.17, 0.20, 0.06, 1.0);;
|
const vec3 lichen_color = vec3 (0.17, 0.20, 0.06);
|
||||||
//float snow_alpha;
|
//float snow_alpha;
|
||||||
|
|
||||||
if (quality_level > 3)
|
if (quality_level > 3)
|
||||||
{
|
{
|
||||||
|
|
||||||
// mix vegetation
|
// mix vegetation
|
||||||
texel = mix(texel, lichen_color, 0.4 * lichen_cover_factor + 0.8 * lichen_cover_factor * 0.5 * (noise_10m + (1.0 - noise_5m)) );
|
texel.rgb = mix(texel.rgb, lichen_color, 0.4 * lichen_cover_factor + 0.8 * lichen_cover_factor * 0.5 * (noise_10m + (1.0 - noise_5m)) );
|
||||||
// mix dust
|
// mix dust
|
||||||
texel = mix(texel, dust_color, clamp(0.5 * dust_cover_factor + 3.0 * dust_cover_factor * (((noise_1500m - 0.5) * 0.125)+0.125 ),0.0, 1.0) );
|
texel.rgb = mix(texel.rgb, dust_color, clamp(0.5 * dust_cover_factor + 3.0 * dust_cover_factor * (((noise_1500m - 0.5) * 0.125)+0.125 ),0.0, 1.0) );
|
||||||
|
|
||||||
// mix snow
|
// mix snow
|
||||||
if (relPos.z + eye_alt +500.0 > snowlevel)
|
if (relPos.z + eye_alt +500.0 > snowlevel)
|
||||||
{
|
{
|
||||||
snow_alpha = smoothstep(0.75, 0.85, abs(steepness));
|
snow_alpha = smoothstep(0.75, 0.85, abs(steepness));
|
||||||
texel = mix(texel, snow_texel, snow_texel.a* smoothstep(snowlevel, snowlevel+200.0, snow_alpha * (relPos.z + eye_alt)+ (noise_2000m + 0.1 * noise_10m -0.55) *400.0));
|
texel.rgb = mix(texel.rgb, snow_texel.rgb, snow_texel.a* smoothstep(snowlevel, snowlevel+200.0, snow_alpha * (relPos.z + eye_alt)+ (noise_2000m + 0.1 * noise_10m -0.55) *400.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,10 @@ varying vec2 grad_dir;
|
||||||
varying float mie_angle;
|
varying float mie_angle;
|
||||||
varying float steepness;
|
varying float steepness;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uniform int colorMode;
|
uniform int colorMode;
|
||||||
|
|
||||||
|
uniform bool raise_vertex;
|
||||||
|
|
||||||
uniform float hazeLayerAltitude;
|
uniform float hazeLayerAltitude;
|
||||||
uniform float terminator;
|
uniform float terminator;
|
||||||
uniform float terrain_alt;
|
uniform float terrain_alt;
|
||||||
|
@ -87,6 +88,8 @@ void main()
|
||||||
steepness = dot(normalize(gl_Normal), vec3 (0.0, 0.0, 1.0));
|
steepness = dot(normalize(gl_Normal), vec3 (0.0, 0.0, 1.0));
|
||||||
grad_dir = normalize(gl_Normal.xy);
|
grad_dir = normalize(gl_Normal.xy);
|
||||||
|
|
||||||
|
if (raise_vertex) gl_Vertex.z+=0.1;
|
||||||
|
|
||||||
// this code is copied from default.vert
|
// this code is copied from default.vert
|
||||||
|
|
||||||
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||||
|
@ -129,21 +132,6 @@ void main()
|
||||||
scattering = ground_scattering + (1.0 - ground_scattering) * smoothstep(hazeLayerAltitude -100.0, hazeLayerAltitude + 100.0, vertex_alt);
|
scattering = ground_scattering + (1.0 - ground_scattering) * smoothstep(hazeLayerAltitude -100.0, hazeLayerAltitude + 100.0, vertex_alt);
|
||||||
|
|
||||||
|
|
||||||
// early culling of vertices which can't be seen due to ground haze despite being in aloft visibility range
|
|
||||||
|
|
||||||
//float delta_z = hazeLayerAltitude - eye_alt;
|
|
||||||
//if (((dist * (relPos.z - delta_z)/relPos.z > visibility ) && (relPos.z < 0.0) && (delta_z < 0.0) && (dist > 30000.0)))
|
|
||||||
if (0==1)
|
|
||||||
{
|
|
||||||
gl_Position = vec4(0.0, 0.0, -1000.0, 1.0); // move outside of view frustrum, gets culled before reaching fragment shader
|
|
||||||
earthShade = 1.0;
|
|
||||||
mie_angle = 1.0;
|
|
||||||
yprime_alt = 0.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
// branch dependent on daytime
|
// branch dependent on daytime
|
||||||
|
|
||||||
if (terminator < 1000000.0) // the full, sunrise and sunset computation
|
if (terminator < 1000000.0) // the full, sunrise and sunset computation
|
||||||
|
@ -284,7 +272,7 @@ float shade_depth = 1.0 * smoothstep (0.6,0.95,ground_scattering) * (1.0-smooth
|
||||||
gl_BackColor.rgb = constant_term.rgb; //gl_BackColor.a = 0.0;
|
gl_BackColor.rgb = constant_term.rgb; //gl_BackColor.a = 0.0;
|
||||||
gl_FrontColor.a = mie_angle;
|
gl_FrontColor.a = mie_angle;
|
||||||
gl_BackColor.a = mie_angle;
|
gl_BackColor.a = mie_angle;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue