Jump to content

rbray89

Members
  • Posts

    2,719
  • Joined

  • Last visited

Everything posted by rbray89

  1. Hmmm... the zip download is giving you trouble? Just tried it and it seems to work...
  2. I'll post an update tomorrow morning. The video is being uploaded as we speak.
  3. oh, and there a Game Object folder in the source link if you want to give it a go yourself Once the scene loads, select the Generate button to perform the magic. This will be automated in the future, but for now it is nice for debugging.
  4. No, I didn't have to do anything... I just added some GUI code to adjust it. My co-ordinate system is phase shifted by 1/4 it seems.
  5. I'm aligning the texture up as we speak! (This could take a while.) This happens WAY more than I'd care to admit.
  6. Good News! My updated shader fixes the lighting bug! I'll be posting a new vid once I get my hands on that sweet, sweet texture from 5thHorseman.
  7. haha, PNG or TGA is good. Any reasonably large size should be good (2K+). It looks FANTASTIC BTW.
  8. Is this the one? http://forum.kerbalspaceprogram.com/entries/971-Doing-Science-Celestial-Body-Biomes!/page5
  9. 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.
  10. 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.
  11. 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.
  12. I had a glimpse at them earlier, and I think that those should work really well.
  13. Anyone will be able to use this alongside any other mods... so it should play nicely, and they can just replace/update the texture. The lights are a completely seperate Game obect with it's own mesh. Could be used with Universe Relpacer without 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 Yeah, I think I'll let the community decide that one. Thanks!
  14. 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!
  15. Thanks! I aim to please! Sorry the video is so long/boring.
  16. So I think I have mosty worked out the city lights: http://forum.kerbalspaceprogram.com/threads/52159-PLUGIN-ALPHA-Cities-and-City-Lights-on-Kerbin I have also given city placement some thought, and I will proably use a texture to generate them... That would make it much easier to align the light texture with the actual cities.
  17. 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
  18. Id be interested in seeing how you handle day/night transition. Right now the lights I posted stay up in daylight as well...
  19. 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.
  20. 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.
  21. 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)|..|.
  22. haha, interesting... I guess I was basing my blocks off of cities like Denver...
  23. 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.
  24. 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)
×
×
  • Create New...