Wouldn't cases 1 and 2 take care of case 3 given their 3D nature?
In the next image, the shadows turn into some ugly artifacts when the sun is directly overhead.
float4 CloudTechPS(CloudVS frg) : COLOR
{
float2 vUVMic = frg.texUV.xy * vMicroOff.zw + vMicroOff.xy;
float2 vUVTex = frg.texUV.xy;
// jarmonik: reduce microtex resolution
vUVMic *= 0.33f;
float a = (tex2Dlod(NoiseTexS, float4(vUVTex,0,0)).r - 0.5f) * ATMNOISE;
float4 cTex = tex2D(DiffTexS, vUVTex);
float4 cMic = tex2D(CloudMicroS, vUVMic);
#if defined(_CLOUDNORMALS)
if (bCloudNorm) {
#if defined(_CLOUDMICRO)
float4 cMicNorm = tex2D(CloudMicroNormS, vUVMic); // Filename "cloud1_norm.dds" (does not exists in distribution)
#endif
// Filter width
float d = 2.0 / 512.0;
float3 nrm = 0;
float3 nrmMicro = 0;
float x1 = tex2D(DiffTexS, vUVTex + float2(-d, 0)).a;
float x2 = tex2D(DiffTexS, vUVTex + float2(+d, 0)).a;
nrm.x = (x1*x1 - x2*x2);
float y1 = tex2D(DiffTexS, vUVTex + float2(0, -d)).a;
float y2 = tex2D(DiffTexS, vUVTex + float2(0, +d)).a;
nrm.y = (y1*y1 - y2*y2);
float m = max(abs(nrm.x), abs(nrm.y));
float dMN = dot(frg.nrmW, vSunDir); // Planet mean normal sun angle
// Bump magnitude/contrast function
// Increase normals contrast based on sun-earth angle.
float contrast = (m * (1.0f + (dMN*2.0f)));
#if defined(_CLOUDMICRO)
// Blend in cloud normals only on thick clouds.
nrm.xy = (nrm.xy + saturate((cTex.a * 4.0f) - 1.5f) * (cMicNorm.rg - 0.5f));
#endif
nrm = normalize(nrm) * contrast;
// jarmonik: sarutate() added as a safety check
nrm.z = sqrt(1.0f - saturate(nrm.x*nrm.x + nrm.y*nrm.y));
// Approximate world space normal from local tangent space
nrm = normalize((vTangent * nrm.x) + (vBiTangent * nrm.y) + (frg.nrmW * nrm.z));
float dCS = dot(nrm, vSunDir); // Cloud normal sun angle
// Brighten the lighting model for clouds, based on sun-earth angle.
// Low sun angles = greater effect. No modulation leads to washed out normals at high sun angles.
dCS = saturate((1.0f - dMN) * (dCS * (1.0f - dCS)) + dCS);
dCS = saturate((1.0f - dMN) * (dCS * (1.0f - dCS)) + dCS);
// jarmonik: With a high sun angle, don't let the dCS go below 0.65f to avoid unnaturally dark edges.
dCS = lerp(0.65f*dMN, 1.0f, dCS);
// Effect of normal/sun angle to color
// Add some brightness (borrowing red channel from sunset attenuation)
// Adding it to the sun illumination factor, taking care to keep from saturating
cTex.rgb *= dCS + ((1.0f - dCS) * 0.2f);
}
#endif
#if defined(_CLOUDMICRO)
float f = cTex.a;
float g = lerp(1.0f, cMic.a, frg.fade.y);
float h = (g + 4.0f)*0.2f;
cTex.a = saturate(lerp(g, h, f) * f);
#endif
// Reduce attenuation near terminator (multiply by 3)
// Change attenuation to be grayscale, not colored (.r not .rgb)
// Ensure illumination goes as far as possible by borrowing red channel (.r)
float3 color = cTex.rgb*saturate(frg.atten.r * 3)*fCloudInts + frg.insca.rgb*vHazeMax;
return float4(saturate(color + a), cTex.a*saturate(fCloudInts*fCloudInts));
}
What about FlightGear? It has an orbital element as well as an atmospheric flight element.Most definitely not, since, cases 1 & 2 wont require a global cloud coverage at all if the camera doesn't go higher that 30km, some synthetic clouds resembling a current local weather is perfectly good enough and that's what FSX and X-Plane are doing as far as I can tell. There's no "big picture" about a global cloud patterns.
float4 CloudTechPS(CloudVS frg) : COLOR
{
float2 vUVMic = frg.texUV.xy * vMicroOff.zw + vMicroOff.xy;
float2 vUVTex = frg.texUV.xy;
// jarmonik: reduce microtex resolution
// vUVMic *= 0.5f; // new
float a = (tex2Dlod(NoiseTexS, float4(vUVTex,0,0)).r - 0.5f) * ATMNOISE;
float4 cTex = tex2D(DiffTexS, vUVTex);
float4 cMic = tex2D(CloudMicroS, vUVMic);
#if defined(_CLOUDNORMALS)
if (bCloudNorm) {
#if defined(_CLOUDMICRO)
float4 cMicNorm = tex2D(CloudMicroNormS, vUVMic); // Filename "cloud1_norm.dds" (does not exists in distribution)
#endif
// Filter width
float d = 2.0 / 512.0;
float3 nrm = 0;
float3 nrmMicro = 0;
float x1 = tex2D(DiffTexS, vUVTex + float2(-d, 0)).a;
float x2 = tex2D(DiffTexS, vUVTex + float2(+d, 0)).a;
nrm.x = (x1*x1 - x2*x2);
float y1 = tex2D(DiffTexS, vUVTex + float2(0, -d)).a;
float y2 = tex2D(DiffTexS, vUVTex + float2(0, +d)).a;
nrm.y = (y1*y1 - y2*y2);
float dMN = dot(frg.nrmW, vSunDir); // Planet mean normal sun angle
#if defined(_CLOUDMICRO)
// Blend in cloud normals only on moderately thick clouds, allowing the highest cloud tops to be smooth.
nrm.xy = (nrm.xy + saturate((cTex.a * 10.0f) - 3.0f) * saturate(((1.0f - cTex.a) * 10.0f) - 1.0f) * (cMicNorm.rg - 0.5f)); // new
#endif
// Increase normals contrast based on sun-earth angle.
nrm.xyz = nrm.xyz * (1.0f + (0.5f * dMN));
// jarmonik: saturate() added as a safety check
nrm.z = sqrt(1.0f - saturate(nrm.x*nrm.x + nrm.y*nrm.y));
// Approximate world space normal from local tangent space
nrm = normalize((vTangent * nrm.x) + (vBiTangent * nrm.y) + (frg.nrmW * nrm.z));
float dCS = dot(nrm, vSunDir); // Cloud normal sun angle
// Brighten the lighting model for clouds, based on sun-earth angle. Twice is better.
// Low sun angles = greater effect. No modulation leads to washed out normals at high sun angles.
dCS = saturate((1.0f - dMN) * (dCS * (1.0f - dCS)) + dCS);
dCS = saturate((1.0f - dMN) * (dCS * (1.0f - dCS)) + dCS);
// jarmonik: With a high sun angle, don't let the dCS go below 0.65f to avoid unnaturally dark edges.
dCS = lerp(0.2f*dMN, 1.0f, dCS);
// Effect of normal/sun angle to color
// Add some brightness (borrowing red channel from sunset attenuation)
// Adding it to the sun illumination factor, taking care to keep from saturating
cTex.rgb *= dCS + ((1.0f - dCS) * 0.2f);
}
#endif
#if defined(_CLOUDMICRO)
float f = cTex.a;
float g = lerp(1.0f, cMic.a, frg.fade.y);
float h = (g + 4.0f)*0.2f;
cTex.a = saturate(lerp(g, h, f) * f);
#endif
// Reduce attenuation near terminator (multiply by 3)
// Change attenuation to be grayscale, not colored (.r not .rgb)
// Ensure illumination goes as far as possible by borrowing red channel (.r)
float3 color = cTex.rgb*saturate(frg.atten.r * 3)*fCloudInts;
// Blend haze without saturating
color = lerp(color, 1.0f, frg.insca.rgb*vHazeMax);
return float4(saturate(color + a), cTex.a*saturate(fCloudInts*fCloudInts));
}
Red = 0.6397
Green = 0.55
Blue = 0.4
RWaveDep = 8
MWaveDep = 2.304
ScaleHeight = 8.11965
DepthClamp = 0.99875
Exposure = 1.1045
TGamma = 1.0128
OutScatter = 0.596748
InScatter = 1.1495
RayleighPhase = 0
MiePower = 0.13005
MiePhase = 0.967558
Aux1 = 0.2073
Aux2 = 1
Aux3 = 0
AGamma = 1.1016
HazeClr = -0.423
HazeIts = 1.6096
Red = 0.6397
Green = 0.5692
Blue = 0.5086
RWaveDep = 8
MWaveDep = 0
ScaleHeight = 8.11965
DepthClamp = 1.25
Exposure = 0.9785
TGamma = 0.3
OutScatter = 0.699867
InScatter = 1.1285
RayleighPhase = -0.75
MiePower = 0.133128
MiePhase = 0.8
Aux1 = 0.2286
Aux2 = 0.725904
Aux3 = 0
AGamma = 1.3308
HazeClr = 1.5
HazeIts = 1.6474
Fully available for Orbiter 2016: http://users.kymp.net/~p501474a/D3D9Client/Will it be available for non-beta, Or is it not compatible ?
The elevation rendering is strange now (In BETA)
When you move around with the external camera relatively shallow, all weird things happen (scenario for easy start attached)...
The elevation rendering is strange now (In BETA)
When you move around with the external camera relatively shallow, all weird things happen (scenario for easy start attached)...
Any idea where to start with getting rid of this weird oily haze around on-orbit sunrises/sunsets? It seems linked to the rayleigh density. It needs to be at the highest setting to get the deep red color seen in this photo series by Bob Behnken during his and Doug Hurley's 62 day stay on the ISS:
BEGIN_DESC
Ganymede surface graphics glitch.
END_DESC
BEGIN_ENVIRONMENT
System Sol
Date MJD 52024.8592697715
END_ENVIRONMENT
BEGIN_FOCUS
Ship GL-01S
END_FOCUS
BEGIN_CAMERA
TARGET GL-01S
MODE Extern
POS 16.337456 -128.901679 -7.734930
TRACKMODE TargetRelative
FOV 41.81
END_CAMERA
BEGIN_HUD
TYPE Surface
END_HUD
BEGIN_MFD Left
TYPE Surface
SPDMODE 1
END_MFD
BEGIN_MFD Right
TYPE Launch
NAV 0
END_MFD
BEGIN_SHIPS
GL-01S:DG-S
STATUS Landed Ganymede
POS 14.0000000 -131.9000000
HEADING 178.06
ALT 2.554
AROT 102.464 46.953 -71.434
RCSMODE 2
AFCMODE 7
PRPLEVEL 0:1.000000 1:1.000000 2:1.000000
NAVFREQ 434 94 84 114
XPDR 0
RCOVER 1.0000 0.0000
HOVERHOLD 0 1 0.0000e+000 0.0000e+000
GEAR 1.0000 0.0000
AAP 0:0 0:0 0:0
PSNGR 2 3 4
PANELCOL 4
TANKCONFIG 1
END
END_SHIPS
BEGIN_DESC
Tethys surface graphics glitch.
END_DESC
BEGIN_ENVIRONMENT
System Sol
Date MJD 52036.3996687836
END_ENVIRONMENT
BEGIN_FOCUS
Ship GL-01S
END_FOCUS
BEGIN_CAMERA
TARGET GL-01S
MODE Extern
POS 6.399219 -107.636825 -7.465196
TRACKMODE AbsoluteDirection
FOV 41.81
END_CAMERA
BEGIN_HUD
TYPE Surface
END_HUD
BEGIN_MFD Left
TYPE Surface
SPDMODE 1
END_MFD
BEGIN_MFD Right
TYPE Launch
NAV 0
END_MFD
BEGIN_SHIPS
GL-01S:DG-S
STATUS Landed Tethys
POS 14.0000000 -131.9000000
HEADING 178.06
ALT 2.568
AROT 102.433 46.892 -71.456
RCSMODE 2
AFCMODE 7
PRPLEVEL 0:1.000000 1:1.000000 2:1.000000
NAVFREQ 434 94 84 114
XPDR 0
RCOVER 1.0000 0.0000
HOVERHOLD 0 1 0.0000e+000 0.0000e+000
GEAR 1.0000 0.0000
AAP 0:0 0:0 0:0
PSNGR 2 3 4
PANELCOL 4
TANKCONFIG 1
END
END_SHIPS
Checked! It's fine now (cubic interpolation & linear interpolation) :thumbup:There is a fix uploaded to trunk. Could you check that the issue is fixed.
I'm having some issues when landed on outer planet moons, when using R4.6 with Orbiter 2016. On most of the Jovian and Saturnian moons I see bad flickering and jumping of textures.
The moons of Uranus and Neptune appear stable but the DG doesn't cast a shadow.
There is a new build uploaded for Orbiter 2016. Could you check if the texture flickering issue is fixed. There is currently no vessel shadow support for planets/moons using the old tile format. Only the new tile format is fully supported.
Broken clouds of Jupiter/Venus should be fixed.
I do still get the effect, in some places, of the vessel separated from its ground shadow by some small altitude. I gather that's an unavoidable consequence of the way surface elevation is calculated now?