Jump to content

Atmosphere buggy in IVA cameras KSP 1.4.x (solved)


Recommended Posts

I've found that the cameras I add to parts don't render the atmosphere under certain conditions.  When I launch a craft (from the VAB or the Space Center scene), and I enter IVA and switch on external cameras (shortly after sunrise), I see this:

wJ7kKo.jpg

If I return to the Space Center and return to the craft and look at the cameras, I see this:

NHrrrQ.jpg

So, it self-corrects.

The second issue is that the skybox seems to be missing overhead.  If I take one of the cameras and tilt it upwards, I eventually find the edge of the sky:

T18bHk.jpg

Likewise, if I put a cameras on the top of the craft aimed straight up, the sky is black.

I don't have Scatterer or EVE installed - the closest I have to a visual mod in this case is Distant Object Enhancement, and just to double-check, I removed that DLL as well.

I create the cameras here, copying the existing flight cameras.  This code worked in 1.3.x, and I'm not sure what I need to do differently to work around it.

One thing I'm doing is that all of the cameras write into the same render texture, but this same behavior has been used in MAS and RPM for several years.

EDIT: Changed from "skybox" to "atmosphere", since it's the atmosphere not rendering at the surface.

EDIT 2: Thanks to @sirkut, found the solution.  GalaxyCamera and Camera ScaledSpace should not be translated; those cameras should only rotate.

Edited by MOARdV
Link to comment
Share on other sites

This is actually a little different than I reported.  I retested the "camera aimed up has no sky" portion, and it turns out that's not true.  On launch, the atmosphere is missing as previously mentioned, but if I go to the space center and return, it's restored, and I can pan the camera clear to the horizon and still see sky.  It looks like the atmosphere layer is generated for maybe the hemisphere that the camera is facing at Start(), but it's unaware that the camera transform was updated.

I found an AtmosphereFromGround object, but it's completely undocumented.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks to @sirkut finding some example code from a mod that doesn't exhibit the problem, I've sorted out the answer (which other people will probably say, "well, duh!" to):

I created copies of the flight cameras for my own camera, but on the prerender step, I rotated and moved all of them to match the parts position.  That was the problem - the GalaxyCamera and Camera ScaledSpace are supposed to remain fixed, it would appear.  Chasing the vessel around moved those cameras outside of the skyboxes and the like.  So, simple solution.

In summary: prior to rendering, update the rotation of all the cameras.  Update the location of only Camera 01, Camera 00, and FXCamera.  GalaxyCamera and Camera ScaledSpace should not move.

Edited by MOARdV
Slipped and hit Save before I was done
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...