Jump to content

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


rbray89

Recommended Posts

From Jebediah's diary:

"I really like my space center, but the rest of Kerbin looks boring from space. I had to fix that! Today I ordered Bill to put light bulbs everywhere. For a second, he hesitated, then asked 'Where?' as if he didn't understand it. 'Every location you can reach. Plains, mountains, the ice caps, even that creepy old airport. Don't leave land unlit, make Kerbin look like a christmas tree.' But something came to my mind: the light bulbs I gave Bill are strong enough to be seen through mountains, and with that much illumination, it might be brighter than Kerbol itself. I don't want my men to land on the sun instead, so I told Bob to follow Bill and put a smoke machine wherever he leaves a light bulb.

Now I have to get back to my work. Nuclear engines look promising... I wonder how many of those I can pack onto a small fuel tank."

Link to comment
Share on other sites

Just to give an idea of what I hope to release next:

qmh1LJs.png

Awww yiss, while the current implementation is nice from orbital/map views, this is really what the gameplay view needs. Piercing through flat clouds doesn't really give the same feeling as going through actual, volumetric ones. Looking forward to seeing how this turns out!

Link to comment
Share on other sites

Hmmm... Really? I know there is a lighting change when viewing the dark side of kerbin up close, but I haven't seen a distinct line.

I think I was in map view when it happened, but I can't seem to be able to replicate it.

I only saw it once, if it happens again I will get a screenshot of it and post it.

Link to comment
Share on other sites

Hm, I noticed some weird interaction with Steam Gauges beta HUD: for some reason when it is active, the clouds render differently. Any idea why? One clue may be that part of the HUD is rendered using materials and direct GL calls as a workaround for a certain unity GUI limitation.
Javascript is disabled. View full album

VERY strange... they could be doing something weird that interacts with the shader. If I were to implement an HUD, I'd just use another camera and set of materials.

Link to comment
Share on other sites

The HUD is actually mostly completely ordinary unity GUI code, but you can't draw an image rotated while clipping it to a straight rectangle using GUI.DrawTextureWithTexCoords, so it actually does it by manually rendering a straight quad, but transforming the texture coordinates to rotate the image:


HUD_ladder.LoadImage(arrBytes);
HUD_ladder.wrapMode = TextureWrapMode.Clamp;
HUD_ladder_mat = new Material(Shader.Find("Hidden/Internal-GUITexture"));
HUD_ladder_mat.mainTexture = Resources.HUD_ladder;


Resources.HUD_ladder_mat.SetPass(0);
}

// Direct drawing calls to get full control over texture coords
GL.Begin(GL.QUADS);
GL.Color(GUI.color * 0.5f); // the shader appears to multiply by 2 for some reason
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, ysize, 0)));
GL.Vertex3(area.xMin, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, ysize, 0)));
GL.Vertex3(area.xMax, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, -ysize, 0)));
GL.Vertex3(area.xMax, area.yMax, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, -ysize, 0)));
GL.Vertex3(area.xMin, area.yMax, 0.1f);
GL.End();

I actually came up with this hack, and it appeared to work perfectly fine until I installed the clouds. Re cameras, I wouldn't even know where to start :)

P.S. Note also that I'm on linux and already had to disable the bump map textures to avoid the issue already reported a few pages before.

Edited by a.g.
Link to comment
Share on other sites

The HUD is actually mostly completely ordinary unity GUI code, but you can't draw an image rotated while clipping it to a straight rectangle using GUI.DrawTextureWithTexCoords, so it actually does it by manually rendering a straight quad, but transforming the texture coordinates to rotate the image:


HUD_ladder.LoadImage(arrBytes);
HUD_ladder.wrapMode = TextureWrapMode.Clamp;
HUD_ladder_mat = new Material(Shader.Find("Hidden/Internal-GUITexture"));
HUD_ladder_mat.mainTexture = Resources.HUD_ladder;


Resources.HUD_ladder_mat.SetPass(0);
}

// Direct drawing calls to get full control over texture coords
GL.Begin(GL.QUADS);
GL.Color(GUI.color * 0.5f); // the shader appears to multiply by 2 for some reason
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, ysize, 0)));
GL.Vertex3(area.xMin, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, ysize, 0)));
GL.Vertex3(area.xMax, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, -ysize, 0)));
GL.Vertex3(area.xMax, area.yMax, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, -ysize, 0)));
GL.Vertex3(area.xMin, area.yMax, 0.1f);
GL.End();

I actually came up with this hack, and it appeared to work perfectly fine until I installed the clouds. Re cameras, I wouldn't even know where to start :)

P.S. Note also that I'm on linux and already had to disable the bump map textures to avoid the issue already reported a few pages before.

Hmm... Do you know what layers you are using for rendering the unity GameObject?

As for the Linux issue, I need to figure out the shader issue. That is a fine workaround. I may check the system to determine if it is Linux or not and disable the bump maps in code in the meantime.

Link to comment
Share on other sites

The HUD is actually mostly completely ordinary unity GUI code, but you can't draw an image rotated while clipping it to a straight rectangle using GUI.DrawTextureWithTexCoords, so it actually does it by manually rendering a straight quad, but transforming the texture coordinates to rotate the image:


HUD_ladder.LoadImage(arrBytes);
HUD_ladder.wrapMode = TextureWrapMode.Clamp;
HUD_ladder_mat = new Material(Shader.Find("Hidden/Internal-GUITexture"));
HUD_ladder_mat.mainTexture = Resources.HUD_ladder;


Resources.HUD_ladder_mat.SetPass(0);
}

// Direct drawing calls to get full control over texture coords
GL.Begin(GL.QUADS);
GL.Color(GUI.color * 0.5f); // the shader appears to multiply by 2 for some reason
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, ysize, 0)));
GL.Vertex3(area.xMin, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, ysize, 0)));
GL.Vertex3(area.xMax, area.yMin, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(xsize, -ysize, 0)));
GL.Vertex3(area.xMax, area.yMax, 0.1f);
GL.TexCoord(mat.MultiplyPoint3x4(new Vector3(-xsize, -ysize, 0)));
GL.Vertex3(area.xMin, area.yMax, 0.1f);
GL.End();

I actually came up with this hack, and it appeared to work perfectly fine until I installed the clouds. Re cameras, I wouldn't even know where to start :)

P.S. Note also that I'm on linux and already had to disable the bump map textures to avoid the issue already reported a few pages before.

As for creating a GUI overlay, one easy solution would be to create a quad mesh on a layer that isn't rendered by any of the other cameras. Then you can create a camera to render the layer above everything else.

Link to comment
Share on other sites

BTW, during last Squadcast devs have told that it's possible to force KSP to run in DX10 mode, which would allow using SM4.0 and SM4.1. That would allow for some very advanced shaders (like geometry shaders to generate cloud sprites)!

Link to comment
Share on other sites

BTW, during last Squadcast devs have told that it's possible to force KSP to run in DX10 mode, which would allow using SM4.0 and SM4.1. That would allow for some very advanced shaders (like geometry shaders to generate cloud sprites)!

That would leave out the Linux crowd no?

Link to comment
Share on other sites

Volumetric clouds! Looks good.

Is that with Unity's built in particle generator thing?

P.S. Don't forget to update the city detail texture.

(Third time lucky...)

Haha, yeah, I'll have to dig through the threads to find them :)

Link to comment
Share on other sites

That would leave out the Linux crowd no?

Not neccesarily. By default KSP runs on DX9 on Windows which limits to SM3, while Mac/Linux versions use OpenGL which doesn't have such limitations. So by forcing it to DX10 you bring Win back to the table for SM4, or if there is a way to force-run it on DX10, there should be a way to force-run in on OGL even on Windows.

Link to comment
Share on other sites

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