Jump to content

[PLUGIN][ALPHA-10] City Lights and Clouds on Kerbin/Others


rbray89

Recommended Posts

I do like how it looks, though I think the texture needs to be higher res to make the lights less "bloby"

Also, what do people think about a cloud layer?

Universe replacer does a pretty good job of clouds, so it depends. Make sure you offer low res textures too- for those who are pushing the RAM limit.

I could not find the download link either, just a whole lot of other stuff. BTW, it might be useful to choose a different name- Kerbin City is taken, so there could be confusion.

Edited by Tw1
Link to comment
Share on other sites

So many posts, so little time... :)

Re. the population levels of the area around KSC, it might be instructive to look at a few major launch sites: Kennedy Space Center at Cape Canaveral, Florida, Baikonur Cosmodrome, Kazakhstan, and Centre Spatial Guyanais at Kourou, French Guiana.

...

Whether you look to CSG or Cape Canaveral for an example, I think the result will be good. Baikonur is a bad fit for the standard space center, but matches KSC2 well (out in the back of beyond, continental).

Good stuff to think about. I was thinking Canaveral when I lit it up, and "This will look weird launching" when I took it away.

The way you've got a few different patterns happening really adds to it. I still think the megacity thing to KSC's north west could be turned down a bit, and some others boosted up a little more.

I agree, now that I've seen it in game. Though I still think that's something that can be done at the end, either in programming or with a filter across the entire image. And removing individual lights or toning down an are will take seconds. Adding lightsto an area to make it look good takes... a lot longer than that :)

The lights are further away from KSC than I expected.

I not sure about the one right above the KSC- the center itself won't create that much light. Perhaps shift it back a little, to represent towns between coast and the Mountains?

I assume you mean the one light above the runway? That was whimsy on my part putting that one light. I agree that it's too much and removed it.

The problem with Kerbin is that it's TINY. It's hard to balance what would actually be with what looks right to us. I'm going far more for what looks right over what would be. I only removed the lights around KSC because I was afraid that they'd look weird during ascent and landing, and they probably will but they now look weird in orbit so I'll be adding at least some back.

It's nice to have empty space- don't add too much!

I agree. I love that the desert is an actual desert and the mountains are sparsely - if at all - populated. But it a lot of the coasts look really wrong with no lights at all or - worse - with lights really close to them but not near them.

What program are you doing it in, just out of interest?

Gimp. I found a nice Earth texture, removed all the dark parts, and have been copy/pasting city-sized blobs in ever since, lining up coastlines with the rotate tool. I've been not straying too far from actual latitude but it doesn't seem to matter much, because most of the populated areas are subarctic in both planets and aren't really skewed that much on the map.

Why are night lights in the video white, while 5thhorseman's are like RL more yellowish?

That was the color of the texture provided. This can/will be tunable to peoples liking in the final version. I have a color mask in the shader that can be easily applied.

Are you sure? They are yellowish on my screen. Are you positive they're not changed to white in the game? I don't think I added any filters that changed it to greyscale.

I do like how it looks, though I think the texture needs to be higher res to make the lights less "bloby"

Ask and ye shall receive. WARNING: 3 meg png, 8192 pixels wide.

Also, what do people think about a cloud layer?

It's the second thing I thought of when I looked at the video, because your lights are a little above the ground. The first thing I thought is "Finally!" :)

Edited by 5thHorseman
Link to comment
Share on other sites

Actually, watching the video again with a less critical eye towards the little issues with coastlines, it looks really really good as-is. I do still want to fix those coastlines and beef up around some of the outlying cities (and yes, look into toning down KSC continent a little) but wow. Wow wow. Seeing the lights on with the lit up mountains around them was... pretty epic.

Link to comment
Share on other sites

Hay this is awesome!!! It would be really nice if you made Kerbin City the most dense spot cause it's meant to be sort of like New York of Kerbin =)

Also, note that the lights from cities spread sort of like dendrites, protruding from cities in star shapes and following the highways according to density (due to most suburbs being formed near them). Two major cities should therefore be connected with a pretty bright highway. Example on New York

Also take geographic location into account. note that river deltas (New York, Sydney), bays (San Fran, St. Petersburg), narrows (Istanbul, Copenhagen), rivers (Babylon), islands close to coast (Hong kong) are most probable locations for big cities as the most cities are formed on locations that have most easily reached resources (as the most fertile land was found near the big rivers) but also provide protection (not open on all sides), generally the most prevalent cities have a perfect balance between the two. On the other hand, there is no need to cover everything homogeneously, make some vast areas unlit or poorly lit like deserts and steppes and countrysides but not only to geographical location but make everything pretty asymmetrical so one continent much poorly lit than the other.

EDIT: Woops I didn't see there are so many pages, I see some of the discussions and the new map now xD

Edited by nothke
Link to comment
Share on other sites

It was a problem with the webpage. I was able to download the project zip when I tried again.

So I installed it, along with my 8k texture, and sent a mission to Mun to check out the lights in both LKO and further away. My impressons:

The lights don't look right in LKO (75-100km). They look more like splotches of whitewash than lights. I think this is because of the way KSP loads textures. Conversely, the lights are too bright from further away. From Mun, they are super bright.

They seem to be floating 10 or so km from the surface. Any way to lower that, or even have it be ON the surface? From high enough it's no big deal, but from lower it's weird.

It still looks pretty awesome. Here's a slideshow of my trip

Javascript is disabled. View full album
Edited by 5thHorseman
Link to comment
Share on other sites

It was a problem with the webpage. I was able to download the project zip when I tried again.

So I installed it, along with my 8k texture, and sent a mission to Mun to check out the lights in both LKO and further away. My impressons:

The lights don't look right in LKO (75-100km). They look more like splotches of whitewash than lights. I think this is because of the way KSP loads textures. Conversely, the lights are too bright from further away. From Mun, they are super bright.

They seem to be floating 10 or so km from the surface. Any way to lower that, or even have it be ON the surface? From high enough it's no big deal, but from lower it's weird.

It still looks pretty awesome. Here's a slideshow of my trip

Javascript is disabled. View full album

NICE! I haven't tried to view from mun yet, so that is good to see. I think I agree. Too Bright. I'll try to adjust the distance function to have a drop-off once 500km or so is reached, and to not render until the lights until the high-poly grid is out of the clipping sphere.

As for the hovering, we can make it so that it can hover closer, but I haven't thought of a good way to make sure it is always above the planet surface... You see, the mountains will clip the light sphere, and then make it disappear from view. There might be a way we can add a height-map to compensate for the vertexes though.

Link to comment
Share on other sites

:confused:

As for the hovering, we can make it so that it can hover closer, but I haven't thought of a good way to make sure it is always above the planet surface... You see, the mountains will clip the light sphere, and then make it disappear from view. There might be a way we can add a height-map to compensate for the vertexes though.

Well one bonus to keep in mind is that I didn't put any lights on the mountains (if there are any, it's likely a mistake from pasting large swaths of sparsely populated areas) so as long as you're above the highest hills, you should be fine.

Looking very good! And I too would love to have clouds as textured on a separate mesh, not a replacement main texture.

Regarding clipping: not that many cities in the mountains, you know--I'd call it a feature, not a bug. :]

I've been Ninja'd!

Edited by 5thHorseman
Link to comment
Share on other sites

Would there be a way to get the city lights to only shine outwards? Like how the inside of a mesh can be made invisible. That would solve the issue of seeing them while you're still bellow.

(If this has been solved and I missed that, please ignore.)

If you can pull of moving clouds without eating up much much memory and CPU, then this would be better than Universe Replacer- especially as you could also see them from below. Mushroomman did the awesome clouds, perhaps someone could contact him, for texture ideas.

cfihwp3.png

(Ignore the planets doing weird things, this was the first Kerbin shot in my imgur album.)

If you can match the awesomeness look here, (and I don't see why not,) this would be an even better way of delivering clouds.

Link to comment
Share on other sites

Would there be a way to get the city lights to only shine outwards? Like how the inside of a mesh can be made invisible. That would solve the issue of seeing them while you're still bellow.

(If this has been solved and I missed that, please ignore.)

If you can pull of moving clouds without eating up much much memory and CPU, then this would be better than Universe Replacer- especially as you could also see them from below. Mushroomman did the awesome clouds, perhaps someone could contact him, for texture ideas.

cfihwp3.png

(Ignore the planets doing weird things, this was the first Kerbin shot in my imgur album.)

If you can match the awesomeness look here, (and I don't see why not,) this would be an even better way of delivering clouds.

They aren't visible from below actually, the shader is culling the backplane, but the lights that do show up are from lights far away.

Link to comment
Share on other sites

Yup! Once again, I just found some textures, but it should be manageable to create some better looking clouds. I move the main texture counter-spin to the planet, and move two other textures for "mixing and fading" the cloud shader formula is as such:

half4 main = tex2D (_MainTex, IN.uv_MainTex);
half4 mixer = tex2D (_Mixer, IN.uv_Mixer);
half4 fader = tex2D (_Fader, IN.uv_Fader);
o.Albedo = (main.rgb)*(fader.rgb);
half3 avg = mixer.rgb*(o.Albedo.rgb*2);
avg = (avg.r+avg.g+avg.b)/3;
o.Alpha = avg;

The city light shader was over-writing the color. Initially I thought the textures you supplied were white, but I noticed there was actually a bug in my lighting function.

I'll be posting an update once the video is uploaded. The code is actually clean now, and much more in a polished state.

Link to comment
Share on other sites

I made a very quick video too. I happened to have a ship returning to Kerbin so I took this while it was approaching. Sadly KAC paused it and thew up a popup right as it was getting interesting, but maybe it makes it a better teaser... :)

Not bad, not bad. They look like they're moving very quickly though, judging from the shadow, the video only showed about an hour. Is it going to be possible to have things that swirl? But good demonstration of the concept.

Link to comment
Share on other sites

Wait, how do you have moving clouds?

Simple code/shader actually:

The shader does blending between 3 different textures to get a fading and rolling effect, and the movement is performed by translating the textures across the surface. You can check the source for more details, but the "magic" occurs here:

void Update()
{
if (cloudMaterial != null)
{
timeDelta = Time.time - timeDelta;
float offset = timeDelta * TimeWarp.CurrentRate * .00125f;
Vector2 mainOff = cloudMaterial.GetTextureOffset("_MainTex");
Vector2 mixOff = cloudMaterial.GetTextureOffset("_Mixer");
Vector2 fadeOff = cloudMaterial.GetTextureOffset("_Fader");

cloudMaterial.SetTextureOffset("_MainTex", new Vector2(mainOff.x+(offset), 0));
cloudMaterial.SetTextureOffset("_Mixer", new Vector2(mixOff.x - (offset / 4.0f), mixOff.y + (offset/3.0f)));
cloudMaterial.SetTextureOffset("_Fader", new Vector2(fadeOff.x + (offset/5.0f), fadeOff.y - (offset/4.0f)));
timeDelta = Time.time;
}
}

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...