+mue 715 Posted May 16, 2015 I ported the fading tod objects functionality from the sf2 shaders to the fe2 shaders. fe2_fading_tods_shader.zip -Copy the shader files (*.fx) into the Terrains\<terrain> folder. -Adjust the variables fadeStartDistance and fadeLength to your likings in the follwing code section of both shader files: float fade_with_distance(float FadeDist) { float fade_alpha = 1.0; //mue: distance at which the object still has alpha = 1.0 (full opaque) const float fadeStartDistance = 3000.0; //in meters //mue: fadeStartDistance + fadeLength = distance at which the object has alpha = 0.0 (full transparent) const float fadeLength = 1000.0; //in meters const float fd = FadeDist - fadeStartDistance; if (fd > 0.0) { fade_alpha = clamp(0.0, 1.0, 1.0 - (fd / fadeLength)); } return (fade_alpha); } -Set in flightengine.ini DetailMeshSize to the rounded up value of (fadeStartDistance + fadeLength) / terrain_tile_size. E.g. fadeStartDistance = 3000.0, fadeLength = 1000.0 and terrain_tile_size = 500 (stock fe2 terrain_tile_size is 500): (3000.0 + 1000.0) / 500 = 8.0, rounding up = 8 => DetailMeshSize=8 -Set in <terrain>_data.ini [solidObjectTextureMaterial] BlendOp=BLEND_SRC_ALPHA (or BLEND_DST_ALPHA) This makes sure that the tod objects are drawn after the terrain tiles (It's a requirement for the fading to work correctly). Unfortunately this has the negative side effects that the tods don't cast shadows anymore and the shadows cast by target objects are visible through the tods. Share this post Link to post Share on other sites
+Geezer 3,569 Posted May 17, 2015 Got it. More excellent work - thanks! Share this post Link to post Share on other sites