Autumn colors by pixel postprocessing with color rotation encoded in the terrain texture alpha channel, used for Atmospheric Light Scattering
This commit is contained in:
parent
70a9b13f45
commit
deba78c4da
6 changed files with 82 additions and 18 deletions
|
@ -636,6 +636,11 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value><use>moonlight</use></value>
|
<value><use>moonlight</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>season</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value><use>season</use></value>
|
||||||
|
</uniform>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>quality_level</name>
|
<name>quality_level</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
|
|
|
@ -1483,7 +1483,7 @@
|
||||||
<name>CropGrassCover</name>
|
<name>CropGrassCover</name>
|
||||||
<name>CropGrass</name>
|
<name>CropGrass</name>
|
||||||
<name>Grassland</name>
|
<name>Grassland</name>
|
||||||
<texture>Terrain/cropgrass-hires.png</texture>
|
<texture>Terrain/cropgrass-hires-autumn.png</texture>
|
||||||
<object-mask>Terrain/cropgrass-hires.mask.png</object-mask>
|
<object-mask>Terrain/cropgrass-hires.mask.png</object-mask>
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
|
@ -1549,7 +1549,7 @@
|
||||||
<material include="Materials/regions/european.xml">
|
<material include="Materials/regions/european.xml">
|
||||||
<name>Town</name>
|
<name>Town</name>
|
||||||
<name>SubUrban</name>
|
<name>SubUrban</name>
|
||||||
<texture>Terrain/town-europe.png</texture>
|
<texture>Terrain/town-europe-autumn.png</texture>
|
||||||
<object-mask>Terrain/town-europe.mask.png</object-mask>
|
<object-mask>Terrain/town-europe.mask.png</object-mask>
|
||||||
<xsize>1024</xsize>
|
<xsize>1024</xsize>
|
||||||
<ysize>1024</ysize>
|
<ysize>1024</ysize>
|
||||||
|
@ -1611,7 +1611,7 @@
|
||||||
<name>MixedCropPastureCover</name>
|
<name>MixedCropPastureCover</name>
|
||||||
<name>MixedCrop</name>
|
<name>MixedCrop</name>
|
||||||
<name>ComplexCrop</name>
|
<name>ComplexCrop</name>
|
||||||
<texture>Terrain/irrcrop-europe.png</texture>
|
<texture>Terrain/irrcrop-europe-autumn.png</texture>
|
||||||
<object-mask>Terrain/irrcrop-europe.mask.png</object-mask>
|
<object-mask>Terrain/irrcrop-europe.mask.png</object-mask>
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
|
@ -1929,7 +1929,7 @@
|
||||||
<name>Scrub</name>
|
<name>Scrub</name>
|
||||||
<name>Sclerophyllous</name>
|
<name>Sclerophyllous</name>
|
||||||
<texture-set>
|
<texture-set>
|
||||||
<texture>Terrain/shrub1.png</texture>
|
<texture>Terrain/shrub1-autumn.png</texture>
|
||||||
<texture n="11">Terrain/grass_green_hires.png</texture>
|
<texture n="11">Terrain/grass_green_hires.png</texture>
|
||||||
<texture n="12">Terrain/herbtundra_iceland.png</texture>
|
<texture n="12">Terrain/herbtundra_iceland.png</texture>
|
||||||
</texture-set>
|
</texture-set>
|
||||||
|
@ -2072,7 +2072,7 @@
|
||||||
<name>DeciduousForest</name>
|
<name>DeciduousForest</name>
|
||||||
<name>Bog</name>
|
<name>Bog</name>
|
||||||
<name>Heath</name>
|
<name>Heath</name>
|
||||||
<texture>Terrain/deciduous-hires.png</texture>
|
<texture>Terrain/deciduous-hires-autumn.png</texture>
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
<light-coverage>10000000.0</light-coverage>
|
<light-coverage>10000000.0</light-coverage>
|
||||||
|
@ -2099,7 +2099,7 @@
|
||||||
<name>MixedForestCover</name>
|
<name>MixedForestCover</name>
|
||||||
<name>MixedForest</name>
|
<name>MixedForest</name>
|
||||||
<name>RainForest</name>
|
<name>RainForest</name>
|
||||||
<texture>Terrain/mixedforest-hires.png</texture>
|
<texture>Terrain/mixedforest-hires-autumn.png</texture>
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
<light-coverage>5000000.0</light-coverage>
|
<light-coverage>5000000.0</light-coverage>
|
||||||
|
@ -2235,7 +2235,7 @@
|
||||||
<name>Scrub</name>
|
<name>Scrub</name>
|
||||||
<name>Sclerophyllous</name>
|
<name>Sclerophyllous</name>
|
||||||
<texture-set>
|
<texture-set>
|
||||||
<texture>Terrain/shrub1.png</texture>
|
<texture>Terrain/shrub1-autumn.png</texture>
|
||||||
<texture n="11">Terrain/grass_hires.png</texture>
|
<texture n="11">Terrain/grass_hires.png</texture>
|
||||||
<texture n="12">Terrain/dirtrock.png</texture>
|
<texture n="12">Terrain/dirtrock.png</texture>
|
||||||
<texture n="12">Terrain/dirtrock.png</texture>
|
<texture n="12">Terrain/dirtrock.png</texture>
|
||||||
|
@ -2534,7 +2534,7 @@
|
||||||
<name>Cemetery</name>
|
<name>Cemetery</name>
|
||||||
<effect>Effects/landmass-nowood</effect>
|
<effect>Effects/landmass-nowood</effect>
|
||||||
<texture-set>
|
<texture-set>
|
||||||
<texture>Terrain/tundra2.png</texture>
|
<texture>Terrain/tundra2-autumn.png</texture>
|
||||||
<texture n="11">Terrain/grass_hires.png</texture>
|
<texture n="11">Terrain/grass_hires.png</texture>
|
||||||
<texture n="12">Terrain/rock.png</texture>
|
<texture n="12">Terrain/rock.png</texture>
|
||||||
</texture-set>
|
</texture-set>
|
||||||
|
@ -2755,14 +2755,14 @@
|
||||||
<effect>Effects/crop</effect>
|
<effect>Effects/crop</effect>
|
||||||
<name>DryCropPastureCover</name>
|
<name>DryCropPastureCover</name>
|
||||||
<name>DryCrop</name>
|
<name>DryCrop</name>
|
||||||
<texture>Terrain/drycrop1.png</texture>
|
<texture>Terrain/drycrop1-autumn.png</texture>
|
||||||
<texture>Terrain/drycrop2.png</texture>
|
<!--<texture>Terrain/drycrop2.png</texture>
|
||||||
<texture>Terrain/drycrop3.png</texture>
|
<texture>Terrain/drycrop3.png</texture>
|
||||||
<texture>Terrain/drycrop4.png</texture>
|
<texture>Terrain/drycrop4.png</texture>-->
|
||||||
<object-mask>Terrain/drycrop1.mask.png</object-mask>
|
<object-mask>Terrain/drycrop1.mask.png</object-mask>
|
||||||
<object-mask>Terrain/drycrop2.mask.png</object-mask>
|
<object-mask>Terrain/drycrop2.mask.png</object-mask>
|
||||||
<object-mask>Terrain/drycrop3.mask.png</object-mask>
|
<object-mask>Terrain/drycrop3.mask.png</object-mask>
|
||||||
<object-mask>Terrain/drycrop4.mask.png</object-mask>
|
<!--<object-mask>Terrain/drycrop4.mask.png</object-mask>-->
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
<solid>1</solid>
|
<solid>1</solid>
|
||||||
|
@ -2902,7 +2902,7 @@
|
||||||
<name>CropWood</name>
|
<name>CropWood</name>
|
||||||
<name>AgroForest</name>
|
<name>AgroForest</name>
|
||||||
<effect>Effects/landmass-nowood</effect>
|
<effect>Effects/landmass-nowood</effect>
|
||||||
<texture>Terrain/cropwood.png</texture>
|
<texture>Terrain/cropwood-autumn.png</texture>
|
||||||
<object-mask>Terrain/cropwood.mask.png</object-mask>
|
<object-mask>Terrain/cropwood.mask.png</object-mask>
|
||||||
<xsize>2000</xsize>
|
<xsize>2000</xsize>
|
||||||
<ysize>2000</ysize>
|
<ysize>2000</ysize>
|
||||||
|
|
|
@ -36,6 +36,7 @@ uniform float wetness;
|
||||||
uniform float fogstructure;
|
uniform float fogstructure;
|
||||||
uniform float snow_thickness_factor;
|
uniform float snow_thickness_factor;
|
||||||
uniform float cloud_self_shading;
|
uniform float cloud_self_shading;
|
||||||
|
uniform float season;
|
||||||
uniform float transition_model;
|
uniform float transition_model;
|
||||||
uniform float hires_overlay_bias;
|
uniform float hires_overlay_bias;
|
||||||
uniform int quality_level;
|
uniform int quality_level;
|
||||||
|
@ -204,6 +205,7 @@ float noise_2000m = Noise2D(rawPos.xy, 2000.0);
|
||||||
// get the texels
|
// get the texels
|
||||||
|
|
||||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
|
float local_autumn_factor = texel.a;
|
||||||
|
|
||||||
float distortion_factor = 1.0;
|
float distortion_factor = 1.0;
|
||||||
vec2 stprime;
|
vec2 stprime;
|
||||||
|
@ -278,6 +280,7 @@ if (tquality_level > 2)
|
||||||
nSum = nSum + 0.4 * (1.0 -smoothstep(0.9,0.95, abs(steepness)+ 0.05 * (noise_50m - 0.5))) * min(1.0, 2.0 * transition_model);
|
nSum = nSum + 0.4 * (1.0 -smoothstep(0.9,0.95, abs(steepness)+ 0.05 * (noise_50m - 0.5))) * min(1.0, 2.0 * transition_model);
|
||||||
mix_factor = smoothstep(0.5, 0.54, nSum);
|
mix_factor = smoothstep(0.5, 0.54, nSum);
|
||||||
texel = mix(texel, mix_texel, mix_factor);
|
texel = mix(texel, mix_texel, mix_factor);
|
||||||
|
local_autumn_factor = texel.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
// then the detail texture overlay
|
// then the detail texture overlay
|
||||||
|
@ -297,11 +300,31 @@ if (tquality_level > 3)
|
||||||
mix_factor = smoothstep(0.47, 0.54, nSum +hires_overlay_bias - dist_fact);
|
mix_factor = smoothstep(0.47, 0.54, nSum +hires_overlay_bias - dist_fact);
|
||||||
if (mix_factor > 0.8) {mix_factor = 0.8;}
|
if (mix_factor > 0.8) {mix_factor = 0.8;}
|
||||||
texel = mix(texel, detail_texel,mix_factor);
|
texel = mix(texel, detail_texel,mix_factor);
|
||||||
|
local_autumn_factor = texel.a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// autumn colors
|
||||||
|
|
||||||
|
float autumn_factor = season * 2.0 * (1.0 - local_autumn_factor) ;
|
||||||
|
|
||||||
|
|
||||||
|
texel.r = min(1.0, (1.0 + 2.5 * autumn_factor) * texel.r);
|
||||||
|
texel.g = texel.g;
|
||||||
|
texel.b = max(0.0, (1.0 - 4.0 * autumn_factor) * texel.b);
|
||||||
|
|
||||||
|
|
||||||
|
if (local_autumn_factor < 1.0)
|
||||||
|
{
|
||||||
|
intensity = length(texel.rgb) * (1.0 - 0.5 * smoothstep(1.1,2.0,season));
|
||||||
|
texel.rgb = intensity * normalize(mix(texel.rgb, vec3(0.23,0.17,0.08), smoothstep(1.1,2.0, season)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const vec4 dust_color = vec4 (0.76, 0.71, 0.56, 1.0);
|
const vec4 dust_color = vec4 (0.76, 0.71, 0.56, 1.0);
|
||||||
const vec4 lichen_color = vec4 (0.17, 0.20, 0.06, 1.0);;
|
const vec4 lichen_color = vec4 (0.17, 0.20, 0.06, 1.0);;
|
||||||
//float snow_alpha;
|
//float snow_alpha;
|
||||||
|
|
|
@ -44,7 +44,6 @@ uniform float wetness;
|
||||||
uniform float fogstructure;
|
uniform float fogstructure;
|
||||||
uniform float snow_thickness_factor;
|
uniform float snow_thickness_factor;
|
||||||
uniform float cloud_self_shading;
|
uniform float cloud_self_shading;
|
||||||
uniform float moonlight;
|
|
||||||
uniform float season;
|
uniform float season;
|
||||||
uniform float windspeed;
|
uniform float windspeed;
|
||||||
uniform float grain_strength;
|
uniform float grain_strength;
|
||||||
|
@ -276,7 +275,7 @@ float dotnoisegrad_10m;
|
||||||
// get the texels
|
// get the texels
|
||||||
|
|
||||||
|
|
||||||
float local_autumn_factor = texel.a;
|
|
||||||
float distortion_factor = 1.0;
|
float distortion_factor = 1.0;
|
||||||
vec2 stprime;
|
vec2 stprime;
|
||||||
int flag = 1;
|
int flag = 1;
|
||||||
|
@ -285,6 +284,7 @@ float dotnoisegrad_10m;
|
||||||
float snow_alpha;
|
float snow_alpha;
|
||||||
|
|
||||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
|
float local_autumn_factor = texel.a;
|
||||||
grain_texel = texture2D(grain_texture, gl_TexCoord[0].st * 25.0);
|
grain_texel = texture2D(grain_texture, gl_TexCoord[0].st * 25.0);
|
||||||
gradient_texel = texture2D(gradient_texture, gl_TexCoord[0].st * 4.0);
|
gradient_texel = texture2D(gradient_texture, gl_TexCoord[0].st * 4.0);
|
||||||
|
|
||||||
|
|
BIN
Textures/Terrain/cropwood-autumn.png
Normal file
BIN
Textures/Terrain/cropwood-autumn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 164 KiB |
|
@ -288,6 +288,42 @@
|
||||||
<col>3</col>
|
<col>3</col>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>Season</label>
|
||||||
|
<halign>left</halign>
|
||||||
|
<row>7</row>
|
||||||
|
<col>0</col>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>summer</label>
|
||||||
|
<halign>right</halign>
|
||||||
|
<row>7</row>
|
||||||
|
<col>1</col>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<slider>
|
||||||
|
<name>season</name>
|
||||||
|
<row>7</row>
|
||||||
|
<col>2</col>
|
||||||
|
<min>0.0</min>
|
||||||
|
<max>2.0</max>
|
||||||
|
<live>true</live>
|
||||||
|
<property>/environment/season</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
<object-name>season</object-name>
|
||||||
|
</binding>
|
||||||
|
</slider>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>late autumn</label>
|
||||||
|
<halign>left</halign>
|
||||||
|
<row>7</row>
|
||||||
|
<col>3</col>
|
||||||
|
</text>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue