Jump to content

SteamGauges Beta release 1.6.1b [27 Dec]


Trueborn

Recommended Posts

Wow having a hud in IVA is awesome.. but pleaaaaaase change that newspaper font into something that looks more technical but thick enough to be easibly readable like this:

url7.jpg

or

air_507a_026.jpg

Edited by nothke
Link to comment
Share on other sites

The markers will come first, but that sounds very interesting. From some brief research, that mode would essentially display (0, 0, 0) (pitch, yaw, roll) as the prograde vector? Thus, to burn prograde you just burn at (0, 0, 0), and retrograde would be (0, 180, 0). To increase inclination (0, 90, 0), etch. That sound about right?

Yeah, pretty much. Basically it treats the orbital plane like the horizon. Very useful since, once you're in orbit, you don't care about your attitude relative to the surface so much as your attitude relative to your current orbit.

Anyway, I haven't had a chance to play with the HUD yet, but I'm really looking forward to it. I do a lot of IVA-only missions, and SteamGauges has already made it easy for me to do a lot of stuff I couldn't do before. Keep up the good work!

Link to comment
Share on other sites

New beta release! Lots of HUD improvements, as well as a few other fixes. The target relative velocity vector is in place, but no other vectors yet. Future improvements include orbital mode (forward velocity is North, and 0 degrees), vertical ascent mode (replaces pitch ladder at high attitudes). Also, the advanced settings window has been expanded because it was getting too big.

5wyQopb.png

yh8bxrz.png

As usual, feedback is appreciated.

Link to comment
Share on other sites

When the HUD is scaled, a black halo appears around its green elements. This is an obvious non-premultiplied alpha artifact, and to fix it you need to either find a way to render your textures with premultiplied alpha, or modify your png images to work around the issue. Specifically, you need to make the image contain a constant green field in the color channel, and only use the alpha to outline the elements; currently transparent areas are black instead. Note the difference after I edited a few images:

DItevmB.png

It does make the image appear more blurry and hard to see over the bright cyan/white portion of the sky near the horizon - but easier to see over the grass.

Link to comment
Share on other sites

Hmm, I'll play around in GIMP and see what I can do. Alternately, this is how I'm doing the Alpha blending currently:


//Alpha blending
Color tmpColor = GUI.color;
GUI.color = new Color(1, 1, 1, SteamGauges.Alpha); //Alpha is the global alpha scale between 1 and 0.10
...
GUI.color = tmpColor; //reset Alpha blend

Is there a better way to do this that would eliminate the issue?

Link to comment
Share on other sites

The problem is in how the color in the textures is blended into the final image by GPU - specifically, how it interprets the alpha channel value. The naive alpha model that everyone knows, where transparency is just added parallel to unchanged color data, does not actually allow mathematically sound linear interpolation. It's easy to realize: if you interpolate white fully opaque color and black fully transparent, you should be getting white half transparent, because in reality there is only one fully transparent 'color', with no actual color information. Instead you get half-transparent grey (or dark green like with these images) - that spurious black leaks into the visible image.

The solution to this is to multiply the color data by the alpha value before interpolation, instead of after - this is called premultiplied alpha. This obviously requires appropriately prepared texture images, and an option in the rendering engine to stop it doing the exact same multiplication during the actual final blending. Alternatively, in this case you can get away with a texture that in effect contains only alpha data, and fixed color for all pixels.

What I've done to those images is basically:

1. Open in GIMP, right click on the layer, select Add layer mask, then Transfer alpha from layer.

2. Right click layer again, check Disable layer mask and uncheck Edit layer mask if set. This reveals the green on black color channel data.

3. Paint the image all flat green.

4. Save as png.

(You might potentially also try to instead convert them to TextureFormat.Alpha8 after loading in your code to leave only the alpha channel in memory, and apply the green color via that color thing. This would allow an option to change the color :) )

Regarding the observed blurring, I wonder if Unity/KSP is doing any silly in-memory compression of the texture images on the fly as they are loaded. These particular textures absolutely must not be compressed. Are you using any KSP functions to load the pictures, or pure original Unity API?

Edit: Ah, btw one image is named "HUD_..." and thus fails to load on linux unless renamed.

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

Here is how I'm loading all my textures. I'm sure there's a better way. I'll try doing that in GIMP.


Byte[] arrBytes;
public static Texture2D Node_no_node = new Texture2D(width, height);
arrBytes = KSP.IO.File.ReadAllBytes<SteamGauges>("Node_no_node.png");
Node_no_node.LoadImage(arrBytes);

Thanks for all your help, I'm not too familiar with textures, or Unity for that matter.

Link to comment
Share on other sites

I think unless you are calling the Compress method yourself later, that bit of code shouldn't be doing any weird compression. :) I wonder why those G and B icons become such unreadable blobs at small scales if the black discoloration is fixed.

You could also paint the image pure white instead of pure green in the above process, and try applying the color via that GUI.color setting. An Alpha8 texture I mentioned is completely equivalent to such an RGBA image - it just uses less memory since it doesn't actually store the uniform white color.

Link to comment
Share on other sites

Pesky capitalized file changed.

It does look like I can assign arbitrary colors to the texture elements using GUI.color. So eventually, expect fully customizable HUD colors (it'll be global to the whole HUD though, because anything else you might as well just repaint the darn textures yourselves). Unfortunately, I've only gotten it to work on textures that are a single layer of text. If I create a new layer from visible and run through the steps above, I end up with a pure green (or white) texture. Same with merging them all into a single texture first. Use of the Alpha8 format doesn't seem to be affecting it (visually) one way or another. Any thoughts on that?

Link to comment
Share on other sites

Could you elaborate? The steps I wrote are supposed to be used on the png files in the zip, which by definition contain one layer. The goal of the whole process is to end up with a png file that has the color channel filled with one uniform color, and only contains useful information in the alpha channel. With multiple layers the inter-layer blending in gimp may be messing things up.

Using Alpha8 is clunky because you apparently have to actually convert the texture in your C# code by adding something like this to the above (obviously untested since I have no full source code to put this in :)):


Texture2D alpha = new Texture2D(width, height, TextureFormat.Alpha8);
alpha.SetPixels(Node_no_node.GetPixels());
alpha.Apply();
Destroy(Node_no_node); // hopefully free the memory for the first object quicker
Node_no_node = alpha;

Link to comment
Share on other sites

@SpaceK531: Absolutely. In your GameData\SteamGauges\Plugins\PluginData\SteamGauges folder there is a file called "config". You can either open it and manually put the gauges where you want (with xmin and ymin), or just delete the file and the plugin will rebuild it the next time you start KSP. Everything should be pretty safely in the upper left hand corner. I'll look into a screen size safety though, so people can't completely loose gauges off the screen.

@a.g.: I was trying it from my original texture files, I'll try just editing the .png's after I get off work. I'll try that alpha8 conversion as well.

Link to comment
Share on other sites

Is there a way to limit the HUD view to IVA only? I'd be willing to learn how to make a prop if you're interested. A lot of my modeling is pretty blocky, but that's due more to collision mesh issues than ability.

Link to comment
Share on other sites

Is there a way to limit the HUD view to IVA only? I'd be willing to learn how to make a prop if you're interested. A lot of my modeling is pretty blocky, but that's due more to collision mesh issues than ability.

Right now I think I'll stick to a straight plugin, but thanks for the offer. I'll take a look at only enabling it in IVA, and add the option if it isn't that hard.

Link to comment
Share on other sites

@SpaceK531: Absolutely. In your GameData\SteamGauges\Plugins\PluginData\SteamGauges folder there is a file called "config". You can either open it and manually put the gauges where you want (with xmin and ymin), or just delete the file and the plugin will rebuild it the next time you start KSP. Everything should be pretty safely in the upper left hand corner. I'll look into a screen size safety though, so people can't completely loose gauges off the screen.

Is there a thing in the KSP API that tells you screen dimensions?

If you enabled a hard-coded limit then those with ridiculously large screens might have a bad time.

Link to comment
Share on other sites

I want you to be able to move part (most) of the window off screen if you want, but not all of it. So I'll probably use a buffer of like, 10 pixels so the left edge of the window can't go past width-10, and the left edge can't go past 10, etc. Thanks for the link a.g. and I'll see what I can do with those textures, now that I'm off for the day.

Link to comment
Share on other sites

I like the instruments very much. Disadvantage is only the amount of screen covered by them.

One thing i'm still missing is an anunciaterpanel (preferably with sound) with Master, Temp., Fuel, RCS, Electricity (etc.).

Edited by TheCardinal
Link to comment
Share on other sites

Hey, I've been having a problem with the gauges, and I'm not sure if its a problem with the mod or on my end, but all of the gauges are completely unreadable. All of the textures are blurred I can't read any of the numbers or writing on them. Now at first I just figured it was the Video settings, because I keep them all down, cause my computer is slow a hell, but I even put them all the way up, and still, they were still bad looking, so unless I'm missing something, I can't seem to get them to be legible.

Link to comment
Share on other sites

Hey, I've been having a problem with the gauges, and I'm not sure if its a problem with the mod or on my end, but all of the gauges are completely unreadable. All of the textures are blurred I can't read any of the numbers or writing on them. Now at first I just figured it was the Video settings, because I keep them all down, cause my computer is slow a hell, but I even put them all the way up, and still, they were still bad looking, so unless I'm missing something, I can't seem to get them to be legible.

Which version are you using? The latest version should have improved HUD readability. What resolution are you running, and have you scaled the gauges up larger? Also, a screen shot might help.

I like the instruments very much. Disadvantage is only the amount of screen covered by them.

One thing I'm still missing is an annunciator panel (preferably with sound) with Master, Temp., Fuel, RCS, Electricity (etc.).

In the next version, the Maneuver Node, Rendezvous, an Radar Altimeter gauges will auto-hide when not valid. This should help a bit with clutter. Turning off the bezels helps as well. I've generally tried to incorporate warning lights in gauges, but I'll consider a master panel.

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