Jump to content

rbray89

Members
  • Posts

    2,719
  • Joined

  • Last visited

Everything posted by rbray89

  1. 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
  2. Id be interested in seeing how you handle day/night transition. Right now the lights I posted stay up in daylight as well...
  3. It looks like it will work well for above views: I still have to tweak the render distance and the values i'm using in the shader. If you are interested, this is it: Shader "AlphaSelfIllum" { Properties { _Color ("Color Tint", Color) = (1,1,1,1) _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white" } Category { Lighting On ZWrite Off Cull Back Blend SrcAlpha OneMinusSrcAlpha Tags {Queue=Transparent} SubShader { Material { Emission [_Color] } CGPROGRAM #pragma surface surf Lambert vertex:vert sampler2D _MainTex; fixed4 _Color; struct Input { float2 uv_MainTex; float3 fooAlpha; }; void vert (inout appdata_full v, out Input o) { // Transform to camera space float dist = distance(float3(0,0,0), mul(UNITY_MATRIX_MVP, v.vertex)); float alpha = dist * .00005; alpha = alpha*alpha; alpha = min(.85,alpha); o.fooAlpha = alpha; } void surf (Input IN, inout SurfaceOutput o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; o.Albedo = c.rgba; o.Alpha = min(c.a, IN.fooAlpha); o.Emission = c.rgba; } ENDCG Pass { SetTexture [_MainTex] { Combine Texture * Primary, Texture * Primary } } } } Fallback "Self-Illumin/VertexLit" } I'm not using any texture with it, but eventually it will be a halogen lamp color with a conical shape. It works fairly well with varying from distance, but it could be better. It is mostly the float alpha = dist * .00005; line I'm tweaking at this point. Though I may make it a cubic distance function instead of a square.
  4. One thing I did notice is that all the buildings are edge to edge. Is this also intentional? You don't have any alleyways, and you generally don't see taller buildings right up next to each-other. I do like how the smaller buildings are connected though. That is closer to reality then having those all separated.
  5. I think I figured out a good way to emulate areal city lights at night... it also has the bonus effect of creating a "light pollution" effect when looking up from within a city. I'll be posting it when I'm done working everything out, but essentially it is a custom distance-sensitive emissive/transparent shader that fades as the camera nears it. What I hope to do is place two quad planes above the city. One at ~200m and the other at ~800m. The lower one would be the exact size of the city, maybe a little bit extra to provide a good "higher res" "light source" at lower altitudes. The upper layer would have a circular gradient texture and would cover ~2x the size of the city to provide a "light dot" that would be seen at much higher altitudes. ie. _ _ _ _ _______ _ _ _ _ ---------------- ..|..(CITY)|..|.
  6. haha, interesting... I guess I was basing my blocks off of cities like Denver...
  7. you don't necessarily need terrain beds either. There are several mechanisms (some more reliable than others) to get terrain information that can be used to place objects DIRECTLY on the ground.
  8. The GameObjects we are using (ie. Meshes, UV maps, Colliders, etc.) are being created on the fly. Kerbtown doesn't allow this without modification, plus, it is nice to get terrain information (ie, if the ground level is 0, we know there is water there and know not to build there)
  9. Haha, great minds think alike! http://forum.kerbalspaceprogram.com/threads/49982-Kerbin-Real-Estate-Procedural-Cities I noticed that your blocks are missing centers... do you plan on resolving that? I found the best way was to sub divide blocks into a grid, and then randomly connect building footprints, fixing corners and connecting the inside blocks to the outside if not. Where did you find your textures? What is your plan to ensure that the city is always on the ground level? P.S. Your scale is MUCH better than mine EDIT: I also wanted to know if you were using UnityEngine.Random or System.Random ? I found the UnityEngine Random was not that at all... in my class that referenced it, it seemed to reset the seed every time the class methods were called.
  10. I will also be calling for building texture sets that people want to be used. The more variety in appearance, the better!
  11. Yeah, these items will be coming. I want to generate other types of buildings and enhance the current appearance of the "office block" style.
  12. hmmm... I just tried a box collider with the same result. I'm programatically generating buildings in c# so I don't know if there is something wrong I'm doing there.
  13. They are a mesh collider. It is placed by pqscity.
  14. Hi all, I was hoping someone might have some information on what is necessary to achieve rooftop colliders like those on the KSP buildings, KerbinCity, etc. Min just make Kerbals roll around. Thanks!
  15. Yeah, the plan was to add additional non-procedural models/sprites to roads (traffic lights, trash bins, bus stops, etc) along with empty lots, construction lots, parking lots, parks, etc. I have some ideas about generating suburbs/farms, but nothing concrete at the moment.
  16. YES! this is exactly the kind of thing I was looking for. Thanks!
  17. I saw that, and I also saw the Kerbin City community project, and that is actually what prompted me to work on this. I hope to have something similar by the time I am done.
  18. Correct. It didn't load things quite how I needed them to be loaded, and I wanted everything to be generated in-game.
  19. The buildings will have collision meshes, and as long as I can figure out how to use appropriate shaders/textures, the cities will be lit at night.
  20. Hi all, I'm in the process of a mod that will create numerous cities around Kerbin. Update!: Added/Adding Lighting mechanism... Added new texture system, but I will be re-developing it as it wasn't very well thought out. I fixed the colider: the Game object layer must be 17 to work with kerbals. I change the hight calculator to be based off the size of the building footprint. Still a bit on the tall side I think. Next up: Textures and emissive materials for night time! It is KerbTown independent, and should be pretty speedy, with lots of interesting geometries and such. However! I am a programmer, not a modeling artist, and I barely whipped out the textures in GIMP. If anyone has sources of or good textures for roofs, windows, vents, building objects, etc, PLEASE post some links here.
  21. Update: I'm going to be needing some textures soon.
  22. I'm currently working on a procedural city generator. First step is done: Generating unique city blocks of various sizes and building configurations. No colliders, unique textures, etc. done yet. Once I start adding windows I'll be using self illuminated shaders to make "lights" from space.
×
×
  • Create New...