Jump to content

[1.1.2][1-1-2] May 13-2016 EnvironmentalVisualEnhancements


rbray89

Recommended Posts

Like "Steve"?

I like "City Lights and Clouds" though these days it should probably be "Clouds and City Lights" :)

Haha, True. I REALLY want to create an asteroid belt too... I'll probably end up calling it "Visual Enhancements" or "Environmental Enhancements" in the future.

Link to comment
Share on other sites

Haha, True. I REALLY want to create an asteroid belt too... I'll probably end up calling it "Visual Enhancements" or "Environmental Enhancements" in the future.

Would the asteroid belt be just like the rings with just a texture? If so just like my rings request if its possible could that region be made a biome (if it even can be) for science experiments :D .

Link to comment
Share on other sites

Would the asteroid belt be just like the rings with just a texture? If so just like my rings request if its possible could that region be made a biome (if it even can be) for science experiments :D .

No, I have an idea as to how to make them "real" ie. collidable, and if the videos I saw regarding the MUN arch are any indication, you could attach a KAS grappling hook to them to "land" on one of the asteroids. I'd have to look into science though.

Link to comment
Share on other sites

Do you have an idea where abouts you would stick them? Having them where Dres's orbit is with a cleared path directly on its orbit and SOI would be pretty neat similiar to how Saturn has some moons within its rings and over time have cleared their path in it .

Link to comment
Share on other sites

Do you have an idea where abouts you would stick them? Having them where Dres's orbit is with a cleared path directly on its orbit and SOI would be pretty neat similiar to how Saturn has some moons within its rings and over time have cleared their path in it .

I was thinking somewhere between Duna and Jool would be good. Lots of open space there.

Link to comment
Share on other sites

Do you know why clouds don't show up on Kerbin with the real solar system mod? They work from the building selection screen thing and from above 70 or so km but not from the surface while in flight. I haven't changed any settings on either mods.

Link to comment
Share on other sites

Do you know why clouds don't show up on Kerbin with the real solar system mod? They work from the building selection screen thing and from above 70 or so km but not from the surface while in flight. I haven't changed any settings on either mods.

There is a value in the common config that has to be modified. It has to be scaled to whatever size Kerbin has been scaled by. You should be able to ask the guys in the Real Solar System mod for the exact values, or just try increasing it by some reasonable factor (10x?) yourself.

Link to comment
Share on other sites

OK, I did some experiments with the weird interaction between steam gauges and the clouds, and it turns out that the issue is somehow caused by the lines setting texture coordinates:


GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, ysize, 0)));

Commenting just those lines out, while obviously breaking the rendering of the relevant part of the HUD, also removes the effect on clouds. This suggests to me that perhaps your shader may be using some uninitialized texture (or texture coordinate) data or something; that would be the natural conclusion if all this was just plain OpenGL programming anyway. Also, when looking at this from space, it is now obvious that the actual effect is to remove the fade-out of the clouds near the horizon, so they become visible over the space background:

Javascript is disabled. View full album
Link to comment
Share on other sites

OK, I did some experiments with the weird interaction between steam gauges and the clouds, and it turns out that the issue is somehow caused by the lines setting texture coordinates:


GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, ysize, 0)));

Commenting just those lines out, while obviously breaking the rendering of the relevant part of the HUD, also removes the effect on clouds. This suggests to me that perhaps your shader may be using some uninitialized texture (or texture coordinate) data or something; that would be the natural conclusion if all this was just plain OpenGL programming anyway. Also, when looking at this from space, it is now obvious that the actual effect is to remove the fade-out of the clouds near the horizon, so they become visible over the space background:

It might not be the above fade out that is the issue. I use Camera Position relative to the origin and vertex to force the alpha down to nothing once outside the sphere to prevent the undersides of the clouds from showing once above them.

 struct Input {
float2 uv_MainTex;
float2 uv_DetailTex;
float2 uv_BumpMap;
float2 viewDist;
};

void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input, o);
float3 normalDir = normalize(mul(_Object2World, v.normal.xyzz).xyz);
float3 modelCam = _WorldSpaceCameraPos;
float3 vertexPos = mul(_Object2World, v.vertex).xyz;
float3 viewVect = normalize( vertexPos - modelCam);
float3 origin = mul(_Object2World, float4(0,0,0,1)).xyz;
-> float diff = distance(origin, vertexPos) - (distance(origin,_WorldSpaceCameraPos));
o.viewDist.x = saturate(.035*distance(vertexPos,_WorldSpaceCameraPos));
-> o.viewDist.y = saturate(diff) * saturate(saturate(.085*distance(vertexPos,_WorldSpaceCameraPos))+ saturate(pow(.8*_FalloffScale*dot(normalDir, -viewVect),_FalloffPow)));;
}

void surf (Input IN, inout SurfaceOutput o) {
half4 main = tex2D (_MainTex, IN.uv_MainTex);
half4 detail = tex2D (_DetailTex, IN.uv_DetailTex);
half3 albedo = main.rgb * (IN.viewDist.x + ((1-IN.viewDist.x)*detail.rgb));// * 1.5;
o.Albedo = albedo * _Color;
half avg = (IN.viewDist.x + ((1-IN.viewDist.x)*detail.a))*main.a;
-> o.Alpha = avg * IN.viewDist.y;
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
}

Link to comment
Share on other sites

Looking at the compiled files for your shaders on github, they appear to do lots of stuff with the tangent attribute of a vertex; however your code does not initialize the mesh tangents anywhere. This might not be the cause of this particular issue, but it can't be good.

Link to comment
Share on other sites

Looking at the compiled files for your shaders on github, they appear to do lots of stuff with the tangent attribute of a vertex; however your code does not initialize the mesh tangents anywhere. This might not be the cause of this particular issue, but it can't be good.

Ah... that could probably cause the shader issue with all the Linux folk. I was under the impression that only normals had to be assigned. I'll add that in tonight. Thanks for pointing that out. I imagine that it might cause the issue. Only one way to find out though :)

Link to comment
Share on other sites

If your releasing a new version may I make a small request? Since the png to tga change the city lights don't seem as bright is it possible to get them closer in brightness to how they were? I can barely make out the city lights from the Munar surface and I miss that ;.; .

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...