ALS procedural rock work
This commit is contained in:
parent
33a9b73b5c
commit
01afaab2e1
2 changed files with 54 additions and 60 deletions
|
@ -4,16 +4,20 @@
|
|||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<!-- light grey rock with pronounced cracks -->
|
||||
<!--<base-color type="vec3d">0.85 0.83 0.81</base-color>
|
||||
<base-color type="vec3d">0.9 0.95 0.94</base-color>
|
||||
<overlay-color type="vec3d">0.9 0.95 0.94</overlay-color>
|
||||
<overlay-alpha type="float">0.4</overlay-alpha>
|
||||
<overlay-bias type="float">0.0</overlay-bias>
|
||||
<contrast type="float">1.0</contrast>
|
||||
<crack-depth type="float">0.6</crack-depth>
|
||||
<crack-pattern-stretch type="float">7.0</crack-pattern-stretch>
|
||||
<rock-brightness type="float">1.3</rock-brightness>
|
||||
<rock-brightness type="float">1.0</rock-brightness>
|
||||
<grain-fade-power type="float">1.0</grain-fade-power>
|
||||
<rock_strata>0</rock_strata>-->
|
||||
<rock_strata>0</rock_strata>
|
||||
|
||||
<!-- dark grey rock with pronounced grain -->
|
||||
<!--<base-color type="vec3d">0.85 0.83 0.81</base-color>
|
||||
<overlay-bias type="float">0.0</overlay-bias>
|
||||
<contrast type="float">1.0</contrast>
|
||||
<crack-depth type="float">0.3</crack-depth>
|
||||
<crack-pattern-stretch type="float">3.0</crack-pattern-stretch>
|
||||
|
@ -21,14 +25,17 @@
|
|||
<grain-fade-power type="float">1.1</grain-fade-power>
|
||||
<rock_strata>0</rock_strata>-->
|
||||
|
||||
<!-- red rock with high crack pattern -->
|
||||
<base-color type="vec3d">0.85 0.53 0.31</base-color>
|
||||
<!-- red rock with slight crack pattern -->
|
||||
<!--<base-color type="vec3d">0.85 0.53 0.31</base-color>
|
||||
<overlay-color type="vec3d">0.9 0.95 0.94</overlay-color>
|
||||
<overlay-alpha type="float">0.1</overlay-alpha>
|
||||
<overlay-bias type="float">0.0</overlay-bias>
|
||||
<contrast type="float">0.6</contrast>
|
||||
<crack-depth type="float">0.2</crack-depth>
|
||||
<crack-depth type="float">0.3</crack-depth>
|
||||
<crack-pattern-stretch type="float">8.0</crack-pattern-stretch>
|
||||
<rock-brightness type="float">1.3</rock-brightness>
|
||||
<grain-fade-power type="float">0.9</grain-fade-power>
|
||||
<rock_strata>0</rock_strata>
|
||||
<grain-fade-power type="float">1.3</grain-fade-power>
|
||||
<rock_strata>0</rock_strata>-->
|
||||
</parameters>
|
||||
|
||||
<technique n="2">
|
||||
|
@ -108,9 +115,9 @@
|
|||
<value><use>transition_model</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>hires_overlay_bias</name>
|
||||
<name>overlay_bias</name>
|
||||
<type>float</type>
|
||||
<value><use>hires_overlay_bias</use></value>
|
||||
<value><use>overlay-bias</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>crack_depth</name>
|
||||
|
@ -237,11 +244,21 @@
|
|||
<type>float</type>
|
||||
<value><use>contrast</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>overlay_alpha</name>
|
||||
<type>float</type>
|
||||
<value><use>overlay-alpha</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>base_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>base-color</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>overlay_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>overlay-color</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>air_pollution</name>
|
||||
<type>float</type>
|
||||
|
@ -497,16 +514,6 @@
|
|||
<type>int</type>
|
||||
<value><use>display_ysize</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>int</type>
|
||||
<value><use>quality_level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>tquality_level</name>
|
||||
<type>int</type>
|
||||
<value><use>tquality_level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>wind_effects</name>
|
||||
<type>int</type>
|
||||
|
|
|
@ -34,11 +34,12 @@ uniform float contrast;
|
|||
uniform float air_pollution;
|
||||
uniform float intrinsic_wetness;
|
||||
uniform float transition_model;
|
||||
uniform float hires_overlay_bias;
|
||||
uniform float overlay_bias;
|
||||
uniform float crack_depth;
|
||||
uniform float crack_pattern_stretch;
|
||||
uniform float grain_fade_power;
|
||||
uniform float rock_brightness;
|
||||
uniform float overlay_alpha;
|
||||
uniform float dust_resistance;
|
||||
uniform float slopeline_strength;
|
||||
uniform float landing_light1_offset;
|
||||
|
@ -46,9 +47,8 @@ uniform float landing_light2_offset;
|
|||
uniform float osg_SimulationTime;
|
||||
|
||||
uniform vec3 base_color;
|
||||
uniform vec3 overlay_color;
|
||||
|
||||
uniform int quality_level;
|
||||
uniform int tquality_level;
|
||||
uniform int wind_effects;
|
||||
uniform int cloud_shadow_flag;
|
||||
uniform int rock_strata;
|
||||
|
@ -307,7 +307,8 @@ float snownoise_50m = mix(noise_50m, slopenoise_100m, clamp(3.0*(1.0-steepness),
|
|||
float crack_noise;
|
||||
float crack_factor;
|
||||
float crack_size;
|
||||
|
||||
float scrack_noise;
|
||||
float scrack_size;
|
||||
|
||||
crack_noise = cnoise_500m + 0.65 * cnoise_250m + 0.42 * cnoise_100m * detail_fade(50.0, view_angle, dist) ;
|
||||
crack_noise = crack_noise + 0.27 * cnoise_50m * detail_fade(25.0, view_angle, dist) ;
|
||||
|
@ -315,11 +316,11 @@ float snownoise_50m = mix(noise_50m, slopenoise_100m, clamp(3.0*(1.0-steepness),
|
|||
crack_noise = crack_noise + 0.11 * cnoise_10m * detail_fade(5.0, view_angle, dist) ;
|
||||
crack_noise = 0.381 * crack_noise;
|
||||
|
||||
float scrack_noise;
|
||||
|
||||
//scrack_noise = cnoise_10m + 0.65 * cnoise_5m * detail_fade(5.0, view_angle, dist);
|
||||
//scrack_noise = scrack_noise + 0.3 * cnoise_2m + 0.1 * cnoise_1m * detail_fade(1.0, view_angle, dist);
|
||||
//scrack_noise = 0.48 * scrack_noise;
|
||||
|
||||
scrack_noise = cnoise_10m + 0.65 * cnoise_5m * detail_fade(5.0, view_angle, dist);
|
||||
scrack_noise = scrack_noise + 0.3 * cnoise_2m + 0.1 * cnoise_1m * detail_fade(1.0, view_angle, dist);
|
||||
scrack_noise = 0.48 * scrack_noise;
|
||||
|
||||
crack_size = 0.02 +0.00001 * dist;
|
||||
crack_factor = smoothstep(0.5-crack_size,0.50,crack_noise) * (1.0-smoothstep(0.51,0.51+crack_size,crack_noise));
|
||||
|
@ -328,39 +329,41 @@ float snownoise_50m = mix(noise_50m, slopenoise_100m, clamp(3.0*(1.0-steepness),
|
|||
crack_size *= 0.5;
|
||||
crack_factor += smoothstep(0.42,0.42+crack_size,crack_noise) * (1.0-smoothstep(0.43,0.43+crack_size,crack_noise));
|
||||
|
||||
//crack_factor +=smoothstep(0.5-crack_size,0.50,scrack_noise) * (1.0-smoothstep(0.51,0.51+crack_size,scrack_noise));// * (1.0- smoothstep(10.0,50.0,dist));
|
||||
scrack_size = crack_size * 4.0;
|
||||
crack_factor += 0.75 * smoothstep(0.5-scrack_size,0.50,scrack_noise) * (1.0-smoothstep(0.51,0.51+scrack_size,scrack_noise))* (1.0- smoothstep(250.0,1000.0,dist));
|
||||
|
||||
|
||||
crack_factor = crack_factor * min(1.0,0.03/crack_size);
|
||||
|
||||
|
||||
|
||||
// distribution of moss and lichen
|
||||
// distribution of overlay color
|
||||
|
||||
|
||||
float lichen_noise;
|
||||
float lichen_factor;
|
||||
float overlay_noise;
|
||||
float overlay_factor;
|
||||
|
||||
lichen_noise = 0.381 * (noise_50m + 0.65 * noise_25m + 0.42 * noise_10m + 0.27 * noise_5m + 0.17 * noise_2m + 0.11 * noise_1m);
|
||||
lichen_noise = lichen_noise + 0.1 * (smoothstep(0.8,0.9, steepness));
|
||||
overlay_noise = 0.381 * (noise_50m + 0.65 * noise_25m + 0.42 * noise_10m + 0.27 * noise_5m + 0.17 * noise_2m + 0.11 * noise_1m);
|
||||
overlay_noise = overlay_noise + 0.1 * (smoothstep(0.8,0.9, steepness));
|
||||
|
||||
overlay_factor = smoothstep(0.7, 0.72, overlay_noise + overlay_bias) + (1.0 - smoothstep(0.2, 0.22, overlay_noise - overlay_bias));
|
||||
|
||||
lichen_factor = smoothstep(0.7, 0.72, lichen_noise) + (1.0 - smoothstep(0.2, 0.22, lichen_noise));
|
||||
const vec4 lichen_color = vec4 (0.17, 0.20, 0.06, 1.0);
|
||||
|
||||
|
||||
// merge the noise components
|
||||
|
||||
//grainy_noise = grainy_noise * (1.0-crack_depth * crack_factor) + 0.5 * crack_depth * crack_factor;
|
||||
texel.rgb = ((1.0 - contrast) + contrast * grainy_noise ) * texel.rgb;
|
||||
|
||||
|
||||
texel.rgb = mix(texel.rgb, overlay_color.rgb,overlay_alpha * overlay_factor);
|
||||
texel.rgb = texel.rgb * ((1.0-crack_depth) +crack_depth*(1.0-crack_factor * (0.5 + 0.5 * noise_50m) ));
|
||||
texel.rgb = texel.rgb * rock_brightness;
|
||||
texel.rgb = mix(texel.rgb, lichen_color.rgb,0.4 * lichen_factor);
|
||||
|
||||
texel.rgb = texel.rgb * rock_brightness;
|
||||
|
||||
texel.rgb = texel.rgb * (1.0 + 0.4 * (noise_01m-0.5) * detail_fade(0.1, view_angle, dist)) ;
|
||||
|
||||
|
||||
const vec4 dust_color = vec4 (0.76, 0.65, 0.45, 1.0);
|
||||
const vec4 lichen_color = vec4 (0.17, 0.20, 0.06, 1.0);
|
||||
|
||||
// mix vegetation
|
||||
float gradient_factor = smoothstep(0.5, 1.0, steepness);
|
||||
|
@ -387,7 +390,7 @@ float water_threshold2;
|
|||
float water_factor =0.0;
|
||||
|
||||
|
||||
if ((dist < 5000.0)&& (quality_level > 3) && (combined_wetness>0.0))
|
||||
if ((dist < 5000.0) && (combined_wetness>0.0))
|
||||
{
|
||||
water_threshold1 = 1.0-0.5* combined_wetness;
|
||||
water_threshold2 = 1.0 - 0.3 * combined_wetness;
|
||||
|
@ -568,30 +571,14 @@ float eqColorFactor;
|
|||
|
||||
|
||||
if (visibility < avisibility)
|
||||
{
|
||||
if (quality_level > 3)
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/(1.0 * visibility + 1.0 * visibility * fogstructure * 0.06 * (noise_1500m + noise_2000m -1.0) ));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/visibility);
|
||||
}
|
||||
// this combines the Weber-Fechner intensity
|
||||
eqColorFactor = 1.0 - 0.1 * delta_zv/visibility - (1.0 - effective_scattering);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (quality_level > 3)
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/(1.0 * avisibility + 1.0 * avisibility * fogstructure * 0.06 * (noise_1500m + noise_2000m - 1.0) ));
|
||||
}
|
||||
else
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/avisibility);
|
||||
}
|
||||
// this combines the Weber-Fechner intensity
|
||||
eqColorFactor = 1.0 - 0.1 * delta_zv/avisibility - (1.0 - effective_scattering);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue