EVE: Environmental Visual Enhancements

EVE: Environmental Visual Enhancements

804k Downloads

cloud rim in scaled space

Galileo88 opened this issue · 19 comments

commented

Using this test set up HERE, I was trying to minimize the cloud rim seen in scaled space. EXAMPLE.
I had some success, changing the _RimDistSub from 1.01 to 0.0001 and messing with the FalloffPow and FalloffScale.

This looks great in scaled space, but unfortunately, setting the _RimDistSub to anything more than 0.0001 results in the rim reappearing and anything less that 1 results in no 2D clouds on the surface.

If this could be rectified, visual mods like SVE or AVP or even default EVE cfgs can take advantage of this and look at least 62.71% better!

commented

As Galileo has stated above, use a stock cloud layer config but change the RimDistSub value to below 0.0001 and from ScaledSpace the cloud layers at the rim no longer render at the rim edges (looking like floating shells), they blend in to the rim and fade out, however, by doing this it causes the 2D clouds not to render when underneath them i.e. landed at the launch pad.

If this cloud layer fade out at the rim in ScaledSpace could be achieved but bypassing the issue of the 2D clouds not rendering when viewing underneath, that would be the desired effect.

In SphereCloud.shader this part of the code is governed by RimDistSub somehwat:

color = _Color * main.rgba * lerp(detail.rgba, 1, detailLevel);

float rim = saturate(dot(IN.viewDir, IN.worldNormal));
rim = saturate(pow(_FalloffScale*rim,_FalloffPow));
float dist = distance(IN.worldVert,_WorldSpaceCameraPos);
float distLerp = saturate(_RimDist*(distance(_PlanetOrigin,_WorldSpaceCameraPos) - _RimDistSub*distance(IN.worldVert,_PlanetOrigin)));
float distFade = 1 - GetDistanceFade(dist, _DistFade, _DistFadeVert);
float distAlpha = lerp(distFade, rim, distLerp);

color.a = lerp(0, color.a, distAlpha);

How does that affect the 2D cloud rendering when below the layer?

commented

I don't understand what you're saying the problem is - you seem to be saying that you found settings that achieve the effect you want.

commented

The issue is, the settings I have achieve the look I want in scaled space, but the 2D texture is not visible if you are below it. As soon as you pass through it, and are above it, the texture fades in and looks fine.

My end goal is I would like to keep the effect I get with those settings and still be able to see the 2D clouds from the surface as well.

You can see the issue if you pop in that test setup I posted and change the RimDistSub to 0.0001 in the cfg. Everything will look good in scaled space, but the 2D clouds will not be visible until you are above them.

commented

My issue is, you're proposing we solve the problem by making it less like real clouds (which would be heavier when viewed at a low angle). The problem is definitely caused by having clouds 2-3% of the radius of the planet above the ground. If Earth, which you're using as a visual reference, had clouds that high, they'd be well into space... exactly as they appear in the "bad" case with EVE.

Is there any more realistic solution than just making them go away?

commented

What else could I possibly propose? I’m asking for artistic freedom here, not a realistic scale of Earth’s clouds. If you don’t want to do it, that’s fine. I really can’t propose anything else to convince you. I’ll just leave this image for reference.

https://goo.gl/images/nquZeX

commented

Rotate the view in the Map View with your "some success" settings. The clouds, rather than disappearing over the horizon, just clip off. To me, this is way worse than the normal case. Sure, it looks fine in static screenshot, but not dynamically.

commented

I played around with camera angles and didn’t see an issue.

commented

I'm pretty sure the shader fix to get what you want is simple though - try this: https://1drv.ms/f/s!Ah0aNuGsTYhahk--Gx37rPjy2Rto

The real problem is that the rim lighting of planets is on the planet surface, not the cloud layer, so I think there is a much better solution, which I'll try to look into.

commented

That you don't see the clouds clipping into space is odd. watch a cloud.... it just clips off into space rather than getting flatter and flatter as it approaches the horizon, as if the clouds are on a bigger sphere than the planet but are masked by the planet's sphere (i.e. exactly what is happening).

commented

I'm still not entirely convinced by any of this. Making the clouds fade out in order to avoid seeing the gap between the sphere of the planet and the top of the atmosphere seems like it would be better achieved by filling that gap with scatterer-like gradient, not artificially ending the clouds earlier so as not to notice them. The causes of the problem are that Kerbin is 600km in radius but has 7km mountains and a 70km high atmosphere with 10km cloud layers. If anything, in reality clouds would be more visible at a low angle.

commented

This is an issue MANY have brought up since EVE has existed. “Hiding” the rim with scatterer is not a good way to solve this issue as it’s still very prominent with scatterer installed. Especially as you come around from the dark side of a body. Also, there are a lot of people that play without scatterer to conserve their FPS. This is something I have been focusing on as you can see with my other issues. EVE is so close, just a couple changes (I don’t know how extensive the changes are) away from being lightweight, 1 stop shop for visual mod creators.

commented

Ok well, I don’t have anymore arguments to convince you otherwise, so you can go ahead and close this issue if you don’t intend to make any changes.

commented

Did you try the new shaders? They fix the not-visible-from-inside-the-sphere issue.

commented

My issue is, you're proposing we solve the problem by making it less like real clouds (which would be heavier when viewed at a low angle). The problem is definitely caused by having clouds 2-3% of the radius of the planet above the ground. If Earth, which you're using as a visual reference, had clouds that high, they'd be well into space... exactly as they appear in the "bad" case with EVE.

Is there any more realistic solution than just making them go away?

The reason/issue that the EVE cloud layers render to look like planar shells at the rim is bad is because, like you referred to Waz, the scale of the bodies in KSP is so small... but because when landed, at ground level, we don't want cloud layers being right on top of the player we have to located them quite a good number of Kilometers above the surface.

This results in relatively very high altitudes for cloud layers compared to the relatively tiny body radius, thus, giving this issue. It's not really a problem with EVE as such but the way in which visual mods typically (and for playability) set themselves up which causes EVE to have the issue.

This issue almost goes away completely when you play in Real Scale as you don't have that massive disproportionate difference in relative altitude between the cloud layer and the body size but it should be appreciated that the VAST majority of players play at stock scale.

Looking at an example screenshot that Galileo linked showing the clouds rendering way above the surface at the rim, I wonder if it would potentially be a resolution to stop clouds rendering from outside the body's visible extent/radius?

Basically stop the clouds rendering to the camera outside of where the red line here dictates: https://i.imgur.com/m1PvjhK.png

I have done a quick and dirty, one minute Photoshop mock up of how the existing EVE currently looks with typical configs (left), and with all clouds past the rim removed i.e. not rendered to the camera (right): https://i.imgur.com/ZGExQ13.png

When you looks a photos from space, you don't see the clouds above or separated from about the horizon rim, as can be seen here: https://images.unsplash.com/photo-1446776811953-b23d57bd21aa & https://pre00.deviantart.net/4830/th/pre/f/2010/308/9/0/clouds_from_space_by_nvseal-d325u4t.jpg ... and you may say, "Well then this is an issue with your configs, your cloud layers are just too high" but again please appreciate that we are dealing with almost like 1:1 surface sized geography/scale but a 1:10 scale on a celestial scale. We typically need the cloud layer altitudes at normal scale rather than the 1:10 Kerbal scale.

What are your thoughts on this Waz?

commented

Yes, that's the effect @Galileo88 is after and is what his config does. The config also made clouds invisible from below, but that's fixed with the alternative shaders.

The problem remains that this creates an unrealistic clipping effect, but I agree that if that's what the artist prefers, then that's their choice.

The correct solution would, I believe, be to add better fresnels and rim lighting to the atmosphere (that which is currently drawn on the surface sphere instead).

commented

The correct solution would, I believe, be to add better fresnels and rim lighting to the atmosphere (that which is currently drawn on the surface sphere instead).

Well if the same resultant effect can be achieved in a more correct or effective way (that doesn't require meteoric amounts of work and coding) then that's probably the better way to go about it.

When changing these areas you suggested, would it create a better faded blend to the atmosphere up to the cloud layers? I am still a little concerned about the disproportionately high altitude of the cloud layers is cause this issue to be amplified but is not really an issue we can get around.

commented

Ok, after running some tests with the new shaders, I love the way it looks from scaled space and from the surface, but I do see what you are saying about the clouds "clipping" into space. Its only really noticeable during the early stages of a launch. I dont have any suggestions on how to fix that. Unfortunately, something like backface culling wont work, i don't think.

commented

One last thing to tack on to my testing from the last couple of days, the new shaders you posted has the same behavior as the old shaders with scatterer installed in that you don't see 2D clouds underneath the layer. I don't know if you plan to use the same shaders in a future release, so I don't know how important getting it to work with scatterer is anyway. Just thought Id let you know any how.

commented

Note that Scatterer uses modified versions of the shaders, so it will need to make the same change.