Jump to content

IVAs with no windows or internal light source still letting outside light in


Recommended Posts

how3fNB.pngGMBwFxT.png

While working on some IVAs, I noticed that eventhough my IVAs have no windows or internal light sources*, for some reason the outside light seems to spill into the IVA regardless. I made sure that my main internal model and IVAs were all set to Layer 16 (Kerbals),

@nli2work, @alexustas, @cxg2827 and all IVA experts - any ideas what I might have missed?

 

*I assume emissives don't count

Link to comment
Share on other sites

This is actually an issue with all the IVAs 1.1. The external model does not cast a shadow on the interior. (It did in 1.0.5)

Made a bug report for the PreRelease and it was confirmed by @Porkjet (i think). Haven't found it though when looking through the tracker. So it might be fixed for the next update or it got lost in the transition to the offcial release.

EDIT: Strange, the bug report completely vanished, it is neither in the PreRelease nor in the release Tracker and isn't even listed in my recent activities there. I am 100% sure that the report existed, one of the Devs even added some additional screenshots to show the issue and compare with 1.0.5.
EDIT2: Well, tracking the report back from my EMails i get this nice message: You are not authorized to access this page. Uhm, what?!

Edited by Nils277
Link to comment
Share on other sites

48 minutes ago, Nils277 said:

This is actually an issue with all the IVAs 1.1. The external model does not cast a shadow on the interior. (It did in 1.0.5)

In hindsight, I just realized that my 1.0.5 IVAs did cast shadows as they were currently configured.

49 minutes ago, Nils277 said:

EDIT: Strange, the bug report completely vanished, it is neither in the PreRelease nor in the release Tracker and isn't even listed in my recent activities there. I am 100% sure that the report existed, one of the Devs even added some additional screenshots to show the issue and compare with 1.0.5.
EDIT2: Well, tracking the report back from my EMails i get this nice message: You are not authorized to access this page. Uhm, what?!

If you could give me the ticket ID, I might be able to look it up.

Link to comment
Share on other sites

3 minutes ago, sumghai said:

In hindsight, I just realized that my 1.0.5 IVAs did cast shadows as they were currently configured.

If you could give me the ticket ID, I might be able to look it up.

:) it's been moved into internal Dev queue. Same happened to one of mine.

Edited by JPLRepo
Link to comment
Share on other sites

18 minutes ago, sumghai said:

In hindsight, I just realized that my 1.0.5 IVAs did cast shadows as they were currently configured.

If you could give me the ticket ID, I might be able to look it up.

The ID of it is: Bug #8439

15 minutes ago, JPLRepo said:

:) it's been moved into internal Dev queue. Same happened to one of mine.

Hmm, that explains it.

Edited by Nils277
Link to comment
Share on other sites

Thanks for the heads-up everyone - I'm relieved to know that it's not a misconfiguration on my part, although it would be nice to have this fixed.

For the time being, I guess I'll test IVA interior lighting in orbit on the dark side of Kerbin.

Link to comment
Share on other sites

As a workaround  one can maybe add a mesh to the IVA that resembles the hull of the part and is not rendered but still casts shadows. Quite similar to the depthmask (actually when the depthmasks only lets you see throught the windws exactly like the depthmask). Maybe it is possible to force the mesh to cast shadows. Another idea would be to disable the backface culling of the interior if possible, so the IVA itself casts shadows inside.

Haven't tried them yet, but will keep you updated when I did.

Edited by Nils277
Link to comment
Share on other sites

Tried out the suggestion(s) and the first one works: The light only comes through the windows. Or actually in your case @sumghai it wouldn't come in at all.

Here is the unity setup:

JbkuGF6.png

A simple mesh with the KSP/Unlit Shader and the opacity set to 0. Cast Shadows for the Mesh Renderer should be on by default.

Note that the faces of this mesh should face to the outside.

Disabling the backface culling prooved to be less easy. One would have to deactivate it in the shaders (while compiling them when i correctly understood the documentation of unity). This would also look ugly with the cutaway feature and is therefore not really an option.

@Porkjet might this also be a possible (easy) fix for the stock IVAs?

Edited by Nils277
Link to comment
Share on other sites

4 minutes ago, Nils277 said:

Tried out the suggestion(s) and the first one works: The light only comes through the windows. Or actually in your case @sumghai it wouldn't come in at all.

Here is the unity setup:

JbkuGF6.png

A simple mesh with the KSP/Unlit Shader and the opacity set to 0. Cast Shadows for the Mesh Renderer should be on by default.

Note that the faces of this mesh should face to the outside.

I'll try out technique number one later tonight, thanks!

Link to comment
Share on other sites

This should probably go to whoever has that issue of Nils277 assigned to them. Not sure who? @Porkjet or @sal_vager or someone might be able to pass it on?

My thoughts here are that given Internal space and external space (Scaled space) are orientated differently.. when you render the IVA camera the way it is now being done in 1.1+ I can't see how you would ever see the shadows of the external part model fall onto the internal model. Given they are in two different location/orientations.
That is assuming the two cameras being used to render both the internal space and external space have the Sun (light source) orientated appropriately for each...
Wouldn't the only way to get the external model / mesh shadow to fall on the internal one would be they are located in the same position and orientation? Or you copy them and put the copy in the right location / orientation?
Or do as Nils277 has suggested and put a copy of the external into the internal model to cast the shadows (just another way of doing the copy or move in real time). Only this way would probably be cheaper.

Link to comment
Share on other sites

A small brainstorming with JLPRepo revealed some even easier ways this could be fixed by Squad: Either also rendering the already added DepthMasks for the Cutaway in the depthmap for the Shadowmaps (given that it only has holes for the windows) or add a shader that is only rendered for the Shadowmaps but not in the actual rendering scene, which might have an even smaller impact on the performance.

Edited by Nils277
Link to comment
Share on other sites

Experimentation with @Nils277's workaround

Mixed results I'm afraid:

uMeBCpG.png

The Portrait camera still appears to be brightly lit on the outside, while the Internal itself in both overlay and IVA views is casting some shadows - but not 100%, as I'm still seeing stray beams of light even though there are no actual windows.

sX7iBci.png

Zooming with the mouse wheel shows another problem - it seems that the unlit shader interferes with the Depth Mask clipping, such that some internal props are masked when they should not be masked (e.g. the locker props for the internal racks).

ujDhumo.png

I think I'll put this aside for the time being.

The case of the "missing" bugtracker ticket

@sal_vager has informed me that the issue has been moved to the internal tracker, but no confirmation as to whether it's actually being worked on, or whether the fix will be implemented in 1.1.3 or 1.2.

Link to comment
Share on other sites

15 minutes ago, sumghai said:

Experimentation with @Nils277's workaround

Mixed results I'm afraid:

uMeBCpG.png

The Portrait camera still appears to be brightly lit on the outside, while the Internal itself in both overlay and IVA views is casting some shadows - but not 100%, as I'm still seeing stray beams of light even though there are no actual windows.

sX7iBci.png

Zooming with the mouse wheel shows another problem - it seems that the unlit shader interferes with the Depth Mask clipping, such that some internal props are masked when they should not be masked (e.g. the locker props for the internal racks).

ujDhumo.png

I think I'll put this aside for the time being.

The case of the "missing" bugtracker ticket

@sal_vager has informed me that the issue has been moved to the internal tracker, but no confirmation as to whether it's actually being worked on, or whether the fix will be implemented in 1.1.3 or 1.2.

Oh, i have not recognized that Kerbals in the Portraits are not affected by this. :-/

Have you used a simplified mesh for the shadows or the original external model? Might be that some details of the external model are too small to be taken into account by the shadowmap.

I think the problem with the masked Props appears because the mesh that casts the shadwos is rendered but with full transparency. All meshes that have also transparency are not rendered when they are behind other meshes with transparency (except the cutoff transparency). This could only be fixed by not rendering the mesh that casts the shadwos in the normal scene at all. 

Thanks for the info on the tracker :) 

Edited by Nils277
Link to comment
Share on other sites

9 minutes ago, Nils277 said:

Have you used a simplified mesh for the shadows or the original external model? Might be that some details of the external model are too small to be taken into account by the shadowmap.

I used a simplified mesh, a 24-sided cylinder with triangular fan ends.

Link to comment
Share on other sites

8 minutes ago, sumghai said:

I used a simplified mesh, a 24-sided cylinder with triangular fan ends.

Hmm...weird, don't know why this is happening then.

The mesh casts shadows in the Kerbals in the Portrait though. Maybe you use layer 20? With layer 16 it works.
Bit i can confirm that the transparent mesh does some really weird things when the cutaway is enabled. Had one Kerbal where the head was invisible and only the eyes and teeth were visible...creepy.

 

Link to comment
Share on other sites

6 minutes ago, Nils277 said:

Maybe you use layer 20? With layer 16 it works.

It made no noticeable difference for me whether I used Layer 16 or 20, unfortunately.

Guess we'll have to wait until 1.1.3 or 1.2, then.

Link to comment
Share on other sites

  • 2 weeks later...
3 hours ago, InsaneDruid said:

Still not fixed, or is it?

 

As of 1.1.3, the issue appears to have been (mostly) resolved:

- @Mu set it so that internal models (not props) now render double-sided shadows

- Most of the stock pods IVAs look better now, but there are occasional bit of stray lights leaking through gaps. @JPLRepo and I suspect that to be issues with individual internal models.

- I revisited my airlock model just now, fewer stray lights leaking in now. Might need to tweak my prop positioning and internal model mesh a bit more, however.

Link to comment
Share on other sites

18 minutes ago, nli2work said:

might help to have some mesh overlap where you are getting leaks. Edges that meet up exactly tend to leak light because shadow map resolution isn't high enough. 

I suspected that to be the case. Will do, thanks!

Link to comment
Share on other sites

  • 2 weeks later...
10 hours ago, JPLRepo said:

Hey @sumghai, curious to know how you went?

I hadn't had time to revisit this just yet I'm afraid, been busy with a major project at work and updating SDHI SMS for 1.1.3.

I'll let you know how I get on later this month.

Link to comment
Share on other sites

  • 4 months later...

@JPLRepo @Nils277

I've resumed work on FusTek after a hiatus, and despite going back and trying @Nils277's idea I still can't seem to get the IVA to cast shadows properly - it's not just sharp edges leaking light in, but entire faces.

I'm currently redoing my IVAs from scratch, experimenting with meshes, normals and shaders. I'm also re-examining @alexustas' ALCOR Pod IVA, since I recall it used to successfully implement IVA shadows, and I want to see how it was implemented / if it had been affected by the 1.2.x updates.

In the meantime, if you guys have advice or sample models I can try, that'd be greatly appreciated.

EDIT: ALCOR hasn't been updated since KSP 1.0.4, and while Alex is working on a fix, the shutters on the latest version don't seem to work, so I can't confirm whether the ALCOR IVA can cast internal shadows properly.

Link to comment
Share on other sites

Hey @sumghai

here is a Unity Package with one of my most recent IVAs: CrewCabin.unitypackage.
It contains the model as Blender File. The shadows are cast correctly from it. Hope this helps.
Btw, i get rid of the leaking edges by having an additional mesh without any sharp egdes (in blender). When set to the right shader (KSP/Alpha/Unlit/Transparent) it does not cause any interference with stock cutout or portraits.  

Edit: If this does not help, could you upload one of your problematic models? Maybe we find something fishy in it that causes your problem :wink: 

Edited by Nils277
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...