Jump to content

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


rbray89

Recommended Posts

This is an alpha release, but getting much closer to a Beta stage.

City Lights for Kerbin and Clouds for Any planet you wish! The config file can be modified to add any number of cloud layers to any planet.

I will be updating all builds here: http://forum.kerbalspaceprogram.com/threads/55905-0-22-Beta-1-City-Lights-and-Clouds

Edited by rbray89
Link to comment
Share on other sites

This is relevant to my interests :)

What resolution do you need the Kerbin texture? I can mock something up quick and tweak it this weekend.

That would be fantastic! Something LARGE. The texture that is 1778x889, but the resolution kinda stinks. Should probably be twice that size. Anything should work provided it maps to kerbin well. Anything transparent should have low alpha. The emissive property comes directly from the rgb component, so if there is enough alfa to keep it from being invisible it will show up as lit.

Thanks!

Link to comment
Share on other sites

No problem! A couple more questions:

Should the area around KSC be well-lit, or barren?

I assume you just want the lights? So the texture I'll provide will just be a big mostly-transparent texture with the dotted lights were ever it looks like there'd be cities and towns?

Here's a quick 3 images to show what I have so far. I'm spending more time on areas that are interesting, and the rest will be just simple. Is this roughly what you're looking for?

With the basic texture:

test1.jpg

Just the lights:

test2.jpg

All transparent:

test3.png

Edited by 5thHorseman
Link to comment
Share on other sites

This could be cool...

There are already a few projects adding cites to Kerbin, some procedural, one of them a community project, creating an explorable, unique city. Perhaps you could think about doing something with them.

Are the lights an added thing, or do they replace the existing Kerbin texture? I'm thinking about how it would interact with universe replacer, which can be used to enhance planet textures, or give them clouds.

Are they working by detecting which part of the planet is facing the sun? It's not quite clear from the video.

Also, the density shown in video, from the Earth textures looks like they are too dense for Kerbin, IMHO. I don't think they're terribly urbanised, and I wouldn't put much around the space center, but that's just my opinion.

It be interesting to debate where the cites on kerbin might be, and which areas are better less populated, but that will be something for when we can investigate Kerbin's biomes.

....

That looks like a lot of thoughts from me!, don't be overwhelmed. I think this would be cool to see, when/if you polish it off.

Link to comment
Share on other sites

I modified the pictures twice since I first uploaded them, so make sure you force a refresh if you've been here before. Most notably, the current pictures no longer have little black bits in the 3rd picture. Those bits should be (and are now) transparent instead.

This could be cool...

There are already a few projects adding cites to Kerbin, some procedural, one of them a community project, creating an explorable, unique city. Perhaps you could think about doing something with them.

Not a bad idea. Just doing the fiddly bits on "Kafrica" was hard, it might be nice to have at least a semblance of where to put actual cities.

Are the lights an added thing, or do they replace the existing Kerbin texture? I'm thinking about how it would interact with universe replacer, which can be used to enhance planet textures, or give them clouds.

From the video, it almost looks like they're floating above the surface. My first thought was "Could this be used to make a cloud layer?" :)

Also, the density shown in video, from the Earth textures looks like they are too dense for Kerbin, IMHO. I don't think they're terribly urbanised, and I wouldn't put much around the space center, but that's just my opinion.

I think they should have several large city areas (North of KSC I think) that would be like Europe, and a few other areas (near the rivers) that should be densely populated. The rest should be just dotted with lights. However I think for aesthetics alone we should at least define the shoreline with lights.

It be interesting to debate where the cites on kerbin might be, and which areas are better less populated, but that will be something for when we can investigate Kerbin's biomes.
Other than the rivers and the area directly around KSC, I'm a bit leery to draw anything until we know where the biomes are. Don't want a major metropolis in the middle of a rainforest!
Link to comment
Share on other sites

However I think for aesthetics alone we should at least define the shoreline with lights.

I second that. If you look at Earth, you see population where there's sea, rivers, or lakes, mainly. That's where most of the big cities will be, and most coastline will be populated to some degree (excepting Antarctica and the Arctic coastlines, naturally).

Wrt. procedurally generated cityscape, it would be excellent if there was a matchup - so the same map that generates the lights is used to generate cityscape. Certainly the location of Kerbin City ought to be picked out with a nice, big blob of light. :)

Link to comment
Share on other sites

Looking great so far, even with the lights not matching the terrain it already looks nice.

How are you currently controlling which lights are on/off i.e. which parts of the planet are in day/night? There seems to be a few points where it was showing lights in the day side and was dark in the night side. I had some ideas of how this could be done but I'm still new to shaders so I'm still trying a few things out in unity first.

Link to comment
Share on other sites

Other than the rivers and the area directly around KSC, I'm a bit leery to draw anything until we know where the biomes are. Don't want a major metropolis in the middle of a rainforest!

We could try to make some assumptions by looking at the terrain and where things sit relative to the equator. But, as things aren't quite going to work, as this is not a planet shaped by nature. Instead, we could choose locations where it would be nice to have a town, and areas where it'd be nice to keep things natural.

@rbray89, I probably should've checked before my first post, as you're the maker of one of the procedural cities mod. Does a separate thread mean that this would be available as a separate thing? That'd be nice if people don't want repeated cities all over the planet.

Link to comment
Share on other sites

This could be cool...

There are already a few projects adding cites to Kerbin, some procedural, one of them a community project, creating an explorable, unique city. Perhaps you could think about doing something with them.

Anyone will be able to use this alongside any other mods... so it should play nicely, and they can just replace/update the texture.

Are the lights an added thing, or do they replace the existing Kerbin texture? I'm thinking about how it would interact with universe replacer, which can be used to enhance planet textures, or give them clouds.

The lights are a completely seperate Game obect with it's own mesh. Could be used with Universe Relpacer without

Are they working by detecting which part of the planet is facing the sun? It's not quite clear from the video.

It uses a custom shader to adjust the Alpha and Emmissive properties when exposed to light. I have a few ideas about why it seems to "Flicker" when the view is panned quickly or time is dilated

Also, the density shown in video, from the Earth textures looks like they are too dense for Kerbin, IMHO. I don't think they're terribly urbanised, and I wouldn't put much around the space center, but that's just my opinion.

It be interesting to debate where the cites on kerbin might be, and which areas are better less populated, but that will be something for when we can investigate Kerbin's biomes.

....

That looks like a lot of thoughts from me!, don't be overwhelmed. I think this would be cool to see, when/if you polish it off.

Yeah, I think I'll let the community decide that one. Thanks!

Link to comment
Share on other sites

No problem! A couple more questions:

Should the area around KSC be well-lit, or barren?

I assume you just want the lights? So the texture I'll provide will just be a big mostly-transparent texture with the dotted lights were ever it looks like there'd be cities and towns?

Here's a quick 3 images to show what I have so far. I'm spending more time on areas that are interesting, and the rest will be just simple. Is this roughly what you're looking for?

With the basic texture:

test1.jpg

Just the lights:

test2.jpg

All transparent:

test3.png

I had a glimpse at them earlier, and I think that those should work really well.

Link to comment
Share on other sites

Looking great so far, even with the lights not matching the terrain it already looks nice.

How are you currently controlling which lights are on/off i.e. which parts of the planet are in day/night? There seems to be a few points where it was showing lights in the day side and was dark in the night side. I had some ideas of how this could be done but I'm still new to shaders so I'm still trying a few things out in unity first.

It's all shader magic. I created a surface shader that uses a modified light mechanism to crank the alpha up/down depending on light intensity. I have a feeling there is something up with the lighting models I'm not handling properly that I have to fix to get rid of the glitchyness.

Link to comment
Share on other sites

@rbray89, I probably should've checked before my first post, as you're the maker of one of the procedural cities mod. Does a separate thread mean that this would be available as a separate thing? That'd be nice if people don't want repeated cities all over the planet.

It probably will be, though at the moment, the same mod is my test-bed for everything. Right now I'm mostly toying with shaders to get the lights right, but I have a bit of a tendency to bounce to whatever I find to be more interesting at the time. The other option would be to simply have it configurable, ie. Lights only, cities only, etc.

Link to comment
Share on other sites

Ah, ok. I was planning on having a shader with an alpha mask that gets offset according to the time of day, I don't know much about shaders so I had no idea it could be done your way, it's much more robust if you can get it work.

Link to comment
Share on other sites

Ah, ok. I was planning on having a shader with an alpha mask that gets offset according to the time of day, I don't know much about shaders so I had no idea it could be done your way, it's much more robust if you can get it work.

Yeah, I think I know the issue... as for the shader, this is my surface lighting function:

inline half4 LightingNone (SurfaceOutput s, half3 lightDir, half atten)
{
half NdotL = dot (s.Normal, lightDir);

float lightIntensity = _LightColor0.a * (NdotL * atten * 32);
float satLight = saturate(lightIntensity);
float invlight = 1-satLight;
invlight = invlight*invlight;
half4 c;

c.a = s.Alpha * invlight;
c.rgb = s.Emission * invlight;
return c;
}

The problem I think I am having is that the lighting wants to use some alternative lighting model at times. Could be as simple as a pragma directive.

Link to comment
Share on other sites

Okay I decided to quadruple the resolution of the already doubled resolution. The final texture will be 8192x4096 though we can scale down to make it any smaller size. I'm going big because it's far easier to scale things down than up.

Rather than post 3 HUGE pictures to show, I'll instead just post 1 with a comparison of what it looks like. I also downloaded AncientGammoner's 8k Kerbin texture for my reference, and changed the lat/long of my lights to match that so it should be easier to import. While I thank AncientGammoner for making the texture available, I stress it will NOT be in the final product at all.

compare_1.jpg

Note, some of the coastline hasn't been completed. Eventually it will go all around the coast with dots everywhere there are not mountains. I may even run roads through the mountains though I'm not sure yet.

I also found a biome map that I'm assuming is accurate, though currently I'm not referencing it.

Link to comment
Share on other sites

Okay I decided to quadruple the resolution of the already doubled resolution. The final texture will be 8192x4096 though we can scale down to make it any smaller size. I'm going big because it's far easier to scale things down than up.

Rather than post 3 HUGE pictures to show, I'll instead just post 1 with a comparison of what it looks like. I also downloaded AncientGammoner's 8k Kerbin texture for my reference, and changed the lat/long of my lights to match that so it should be easier to import. While I thank AncientGammoner for making the texture available, I stress it will NOT be in the final product at all.

compare_1.jpg

Note, some of the coastline hasn't been completed. Eventually it will go all around the coast with dots everywhere there are not mountains. I may even run roads through the mountains though I'm not sure yet.

I also found a biome map that I'm assuming is accurate, though currently I'm not referencing it.

This looks fantastic so far!

Link to comment
Share on other sites

Wow, that's already coming along nicely. May I suggest putting some extra lights around that lower bay. The Kerbin City mod is situated there. Might be a nice nod to that and it's also a nice natural harbor, which would make it a attractive place to start a city. I am worried that you're going a bit crazy with the lights though. Few areas on Earth look that dense.

World_Night_Lights_Map.jpg

Link to comment
Share on other sites

This looks fantastic so far!

Thank you! I cycle between this overwhelming dread that I've bitten off more than I can chew, and shocked amazement that it's coming along so nicely.

That's the one! :)

Wow, that's already coming along nicely. May I suggest putting some extra lights around that lower bay. The Kerbin City mod is situated there. Might be a nice nod to that and it's also a nice natural harbor, which would make it a attractive place to start a city. I am worried that you're going a bit crazy with the lights though. Few areas on Earth look that dense.

My thought is that Kerbals live primarily in the areas around KSC and the "Europe" kind of place just to the North, and also on those rivers. They do however live everywhere on the planet so every area will be dotted with lights, even if very lightly.

It looks dense because I started where it IS dense. Most of the map won't be nearly so lit. Especially all the mountains and that huge desert on the continet west of KSC will be quite barren. And what I believe is rainforest on the biome map.

Also note that you can very easily crank down the brightness, either in code or in the image after the fact. You can procedurally remove any level you want. You can't procedurally ADD lights, though, so I'm starting with the max needed. Plus, it just looks so cool :D

By "Lower bay" do you mean down near the southern tip of Kafrica? I'm fiddling with that now actually. :)

Here's a quick update pic, not full resolution because it's so frickin' huge.

compare_2.jpg

I think when I finish this I may want it on my wall :D

Edited by 5thHorseman
Link to comment
Share on other sites

That zoomed out pic already makes it look a lot better. My worries have disappeared.

To further assuage your fears, here's the current full-globe map which is obviously not finished and obviously not full res:

night_1.jpg

Kerbin City is here:

0gdKFRbl.jpg

Sweet thanks. I'll beef that up next update.

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...