Jump to content

[1.12.X] Neptune Camera - Basic Camera Utility [4.2][21.06.2023]


Beale

Recommended Posts

On 10/27/2020 at 7:26 PM, dieDoktor said:

Would you say that the camera transform step is particularly difficult? I ask because I would like to apply the module to other mods I have installed but I don't have any experience with Unity. (Although I do feel confident in my ability to edit text files :D

Thanks : )

Heya,

If you're adding it to your own parts it's incredibly incredibly easy, just keep the transform Blue = forward, Green = up.
Adding to somebody else's parts is a little trickier, because you will need to import the Mu file, but there are tools for this (Taniwha blender Mu plugin for example).

Link to comment
Share on other sites

Some testing results ...

Spoiler

Using this config:


@PART[bluedog_LunarOrbiter_Camera]
{
    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle = True
        cameraCustomTitle = "HighRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 30
        cameraHorizontalResolution = 800
        cameraVerticalResolution = 600
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength=8
    }

    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle=True
        cameraCustomTitle = "MedRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 140
        cameraHorizontalResolution = 640
        cameraVerticalResolution = 480
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength = 4
    }

}
 

This is what happens in game:

Here's the PAW, looks perfect. I wasn't sure if the custom camera was per part, or per transform, but this seems to be working with two cameras on a single transform.

9Ncvem4.png

Here's MedRes followed by HighRes taken right after each other click click. To me it looks right except the FOV looks identical in both images? Have I declared something incorrectly?

UfYCXWm.png

bvsnN6E.png

 

 

Link to comment
Share on other sites

13 minutes ago, OrbitalManeuvers said:

Some testing results ...

  Hide contents

Using this config:


@PART[bluedog_LunarOrbiter_Camera]
{
    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle = True
        cameraCustomTitle = "HighRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 30
        cameraHorizontalResolution = 800
        cameraVerticalResolution = 600
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength=8
    }

    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle=True
        cameraCustomTitle = "MedRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 140
        cameraHorizontalResolution = 640
        cameraVerticalResolution = 480
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength = 4
    }

}
 

This is what happens in game:

Here's the PAW, looks perfect. I wasn't sure if the custom camera was per part, or per transform, but this seems to be working with two cameras on a single transform.

9Ncvem4.png

Here's MedRes followed by HighRes taken right after each other click click. To me it looks right except the FOV looks identical in both images? Have I declared something incorrectly?

UfYCXWm.png

bvsnN6E.png

 

 

I think you can do a commit in the BDB GitHub page to add this functionality.

Link to comment
Share on other sites

11 hours ago, OrbitalManeuvers said:

Going for a wild guess here. Does this cull objects from the scene based on their distance from the transform? Like, for removing other spacecraft parts from the image?

Exactly right yeah - anything closer than the near clip plane will not be drawn in the camera image.

10 hours ago, OrbitalManeuvers said:

Some testing results ...

  Reveal hidden contents

Using this config:


@PART[bluedog_LunarOrbiter_Camera]
{
    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle = True
        cameraCustomTitle = "HighRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 30
        cameraHorizontalResolution = 800
        cameraVerticalResolution = 600
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength=8
    }

    MODULE
    {
        name = ModuleNeptuneCamera
        cameraHasCustomTitle=True
        cameraCustomTitle = "MedRes"
        cameraTransformName = cameraTransform

        cameraType = GREYSCALE_COLOUR
        cameraFieldOfView = 140
        cameraHorizontalResolution = 640
        cameraVerticalResolution = 480
        cameraHasErrors = True
        cameraErrorRate = 1
        cameraHasNoise = True
        cameraNoiseMaxStrength = 4
    }

}
 

This is what happens in game:

Here's the PAW, looks perfect. I wasn't sure if the custom camera was per part, or per transform, but this seems to be working with two cameras on a single transform.

9Ncvem4.png

Here's MedRes followed by HighRes taken right after each other click click. To me it looks right except the FOV looks identical in both images? Have I declared something incorrectly?

UfYCXWm.png

bvsnN6E.png

 

 

This seems like a bug - you have everything correct in config. I will investigate that the FOV is getting applied properly.

Thanks for reporting!

Link to comment
Share on other sites

6 hours ago, Beale said:

This seems like a bug - you have everything correct in config. I will investigate that the FOV is getting applied properly.

Thank you so much! Sorry, more questions whenever you have a moment ...

When deciding on an FOV value for a camera, did you have any guidelines in mind? Is there any kind of numerical relationship between a camera's RL focal length and some reasonable FoV value in KSP? I'm guessing that as focal length goes up, FoV goes down, but that's just a guess about how KSP handles FoV. If you had any kind of method when adding this to the SP stuff, that would be super helpful to know.

Also, how similar is the FoV feature to how the Kerbnet window's slider behaves? Lastly, do you have min/max values?

Thanks again!

Edited by OrbitalManeuvers
typos
Link to comment
Share on other sites

1 hour ago, OrbitalManeuvers said:

Thank you so much! Sorry, more questions whenever you have a moment ...

When deciding on an FOV value for a camera, did you have any guidelines in mind? Is there any kind of numerical relationship between a camera's RL focal length and some reasonable FoV value in KSP? I'm guessing that as focal length goes up, FoV goes down, but that's just a guess about how KSP handles FoV. If you had any kind of method when adding this to the SP stuff, that would be super helpful to know.

Also, how similar is the FoV feature to how the Kerbnet window's slider behaves? Lastly, do you have min/max values?

Thanks again!

It is a bit hard to explain well really - I have a lot of experience with the Unity camera and well... first person shooters :D So it feels intuitive enough when I am playing around.

The numbers should be quite close to Kerbnet actually, so that is a good rough guide to use. The default FOV, if you don't specify one is the normal KSP camera FOV (I think around 70).
There are currently no minimum or maximum values, but a too wide, and possible a too small FOV will probably cause visual bugs - a range of maybe 5 to 100 seems safe to me for a gut instinct.

In the future, I would like to look at the possibility of allowing a slider to change FOV in flight (within configurable min-max values), but of course this requires a little more careful thought.

For your immediate issue - here is a patch :)

Neptune Camera V2.5.1

Download and Releases (GitHub)

Source Code (GitHub)

Fixes to custom field of views for camera. You must now use in config the flag "cameraHasCustomFieldOfView" to use this. (Explanation on first page).

cameraHasCustomFieldOfView = True
cameraFieldOfView = 20

KQGmBrd.jpg Custom FOV (20)
rr0bLm4.jpeg Standard FOV
fOszdy7.jpg Two cameras, custom FOV and standard.

Edited by Beale
Link to comment
Share on other sites

Unfortunately, this build causes KSP to hang on startup for me, just as it's loading bluedog_LunarOrbiter_Camera, which is the only part I have that uses Neptune.

This folder has both my log file and the cfg I'm using:  https://drive.google.com/drive/folders/1cvhcCPVdBoCOkm6XLxIK-gIOrnQi0N2L?usp=sharing

Just as another data point, I tried this twice, once both cameras had custom FOV and once only one did.

But maybe I can save you the download, here's the end of the log:

Spoiler


[EXC 10:10:59.802] FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.Format (System.String format, System.Object[] args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    NeptuneCamera.ModuleNeptuneCamera.GetInfo () (at <be8e2b05a1e342bb8fbdd06a34088c7c>:0)
    PartLoader.CompilePartInfo (AvailablePart newPartInfo, Part part) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    PartLoader+<CompileParts>d__56.MoveNext () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

 

Link to comment
Share on other sites

3 hours ago, OrbitalManeuvers said:

Unfortunately, this build causes KSP to hang on startup for me, just as it's loading bluedog_LunarOrbiter_Camera, which is the only part I have that uses Neptune.

This folder has both my log file and the cfg I'm using:  https://drive.google.com/drive/folders/1cvhcCPVdBoCOkm6XLxIK-gIOrnQi0N2L?usp=sharing

Just as another data point, I tried this twice, once both cameras had custom FOV and once only one did.

But maybe I can save you the download, here's the end of the log:

  Hide contents


[EXC 10:10:59.802] FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.Format (System.String format, System.Object[] args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    NeptuneCamera.ModuleNeptuneCamera.GetInfo () (at <be8e2b05a1e342bb8fbdd06a34088c7c>:0)
    PartLoader.CompilePartInfo (AvailablePart newPartInfo, Part part) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    PartLoader+<CompileParts>d__56.MoveNext () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

 

Argh! Okay I will patch as soon as possible, look like a VAB window issue.

Thanks for log.

Edited by Beale
Link to comment
Share on other sites

Using this in combination with Probe control room is incredibly fun, wish more mods picked up on this

That said, just updated to last version and now I'm getting stuck loading TantaresSP/../1f_sensor_visible_light_camera_srf_1 :'( 

Edited by Black034
Link to comment
Share on other sites

13 hours ago, computercat04 said:

When I downloaded the latest release, I found a problem. The loading screen got stuck here. Here's the KSP.log.

19 hours ago, OrbitalManeuvers said:

Unfortunately, this build causes KSP to hang on startup for me, just as it's loading bluedog_LunarOrbiter_Camera, which is the only part I have that uses Neptune.

This folder has both my log file and the cfg I'm using:  https://drive.google.com/drive/folders/1cvhcCPVdBoCOkm6XLxIK-gIOrnQi0N2L?usp=sharing

Just as another data point, I tried this twice, once both cameras had custom FOV and once only one did.

But maybe I can save you the download, here's the end of the log:

  Reveal hidden contents


[EXC 10:10:59.802] FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.String.Format (System.String format, System.Object[] args) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    NeptuneCamera.ModuleNeptuneCamera.GetInfo () (at <be8e2b05a1e342bb8fbdd06a34088c7c>:0)
    PartLoader.CompilePartInfo (AvailablePart newPartInfo, Part part) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    PartLoader+<CompileParts>d__56.MoveNext () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

 

6 hours ago, Black034 said:

Using this in combination with Probe control room is incredibly fun, wish more mods picked up on this

That said, just updated to last version and now I'm getting stuck loading TantaresSP/../1f_sensor_visible_light_camera_srf_1 :'( 

Sorry for the issues fellas, I made a really silly mistake in deployment!

Hotfix below.

Neptune Camera V2.5.2

Download and Releases (GitHub)

Source Code (GitHub)

SUuLclH.jpg
Camera from TantaresSP

7 hours ago, Aahz88 said:

Love your mod! I made a stereoscopic camera. 

Cross your eyes:

SwDEmDi.png

 

Or use red-blue glasses:

pRAV5YS.png

 

https://imgur.com/a/TrLcFbH

I've been looking forward to this since I first saw those parts, great!

Link to comment
Share on other sites

2 hours ago, computercat04 said:

Hey @Beale, can you make a simple UI showing where a camera is pointing at? 

From working on all the BDB cameras, I'm wondering what you'd hope to accomplish with this, or what you're hoping it would help you with? If the camera transform isn't present or isn't pointing in the right direction, there's nothing you can do about it without editing the unity model, and if you can do that you already know what direction the transform is facing. All you'd get from a UI element is "yup, it's wrong" which you already knew since the pictures didn't come out right. That's what this process is:  https://github.com/CobaltWolf/Bluedog-Design-Bureau/issues/964 

There is a mod you can use in the VAB that shows you lots of debug info like the transforms and their orientations, but it's horrible to use and its displays are essentially useless at the end of the day, for the above reason that there's nothing you can do with the information except maybe report it to the mod author, which you can already do just based on the resulting images. (And I'll just add that the BDB cameras don't need any more bug reports, they already have the complete list of all cameras that needs tweaks.)

 

Link to comment
Share on other sites

On 11/13/2020 at 1:54 PM, computercat04 said:

Hey @Beale, can you make a simple UI showing where a camera is pointing at? 

On 11/13/2020 at 4:15 PM, OrbitalManeuvers said:

From working on all the BDB cameras, I'm wondering what you'd hope to accomplish with this, or what you're hoping it would help you with? If the camera transform isn't present or isn't pointing in the right direction, there's nothing you can do about it without editing the unity model, and if you can do that you already know what direction the transform is facing. All you'd get from a UI element is "yup, it's wrong" which you already knew since the pictures didn't come out right. That's what this process is:  https://github.com/CobaltWolf/Bluedog-Design-Bureau/issues/964 

There is a mod you can use in the VAB that shows you lots of debug info like the transforms and their orientations, but it's horrible to use and its displays are essentially useless at the end of the day, for the above reason that there's nothing you can do with the information except maybe report it to the mod author, which you can already do just based on the resulting images. (And I'll just add that the BDB cameras don't need any more bug reports, they already have the complete list of all cameras that needs tweaks.)

 

A full UI is out of scope. I could add a visible ray to show exactly where / what the camera is pointing at, but not really sure how desirable that is.

 

Link to comment
Share on other sites

  • 2 months later...
On 11/13/2020 at 1:15 PM, OrbitalManeuvers said:

From working on all the BDB cameras, I'm wondering what you'd hope to accomplish with this, or what you're hoping it would help you with? If the camera transform isn't present or isn't pointing in the right direction, there's nothing you can do about it without editing the unity model, and if you can do that you already know what direction the transform is facing. All you'd get from a UI element is "yup, it's wrong" which you already knew since the pictures didn't come out right. That's what this process is:  https://github.com/CobaltWolf/Bluedog-Design-Bureau/issues/964 

There is a mod you can use in the VAB that shows you lots of debug info like the transforms and their orientations, but it's horrible to use and its displays are essentially useless at the end of the day, for the above reason that there's nothing you can do with the information except maybe report it to the mod author, which you can already do just based on the resulting images. (And I'll just add that the BDB cameras don't need any more bug reports, they already have the complete list of all cameras that needs tweaks.)

 

I believe he just wanted an integrated UI of what the camera is showing while playing, not a technical aspect of where the lens is pointing in the model. In other words, much like the current telescope mods. That let's you move the camera live, and take pictures while actively showing you the camera.

 

I have a small request. Is it possible to have an option, or a hotkey so that the camera can take photos automatically at a regular interval?

 

Because one of the things I love about this mod is taking pictures every 5-10 seconds while orbiting or while landing, and it would be much much easier if I could focus on the landing, instead of having to both land and take a picture every X seconds.

Edited by Sesshaku
Link to comment
Share on other sites

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