Jump to content

[1.12.x] JSI Advanced Transparent Pods (V0.1.24.0) 12th Sep 2021


JPLRepo

Recommended Posts

 

JSI Advanced Transparent Pods

This module is an update to the previous module and will be known as JSIAdvTransparentPods.

NOTE: This mod does nothing on its own. It’s functionality becomes available to other mods that use this mod.
 

Features of this module include:

  • Transparency feature for configured parts that will show the IVA internal models of parts that have been configured to use this module.
  • Ability to Swap Shaders on the External and Internal model to make Window appear Opaque or Transparent.
  • Ability to toggle Transparency setting ON/OFF/AUTO (mouse over) on a part by part basis.
  • Transparency (show internals) for ALL Loaded vessels (not just the Active Vessel).
  • Automatically handles and supports when the user Toggles the stock IVA Overlay feature on and off.
  • Supports Transparency feature for ALL parts that have Internal Models (and have been configured to use this mod) regardless of whether they have InternalSeats (crew capacity), whereas the stock overlay mode only shows internals of crewed parts.
  • Works in Editor mode (although it does not support the DepthMask Shader meshes in Editor mode) you only see the entire IVA over the external when you turn TransparentPod mode ON in the editor.
  • Ability to have two different Overlay modes - one for TransparentPod mode (say just transparent windows) and another for the stock overlay mode on modders internal models.

Future Enhancements:

  • Support for DepthMask shaders in the Editors.

For mod authors you need to follow the specific requirements of this mod in your models and config files.
For details on that refer to the wiki site page

Known Issues:

  • Due to Unity camera limitations and the way KSP camera and universe is set-up (It's complicated, but if you want the full explanation send me a PM) any objects in the foreground of an IVA can be occluded/cut-off by the IVA. This also occurs with the stock overlay feature introduced in KSP 1.1. I have implemented some basic ray casting to help allieviate this, but it only works when the object in front of an IVA is directly between the IVA and the player's viewing camera. I am investigating other ways to deal with this issue, such as shaders and depth-buffer, hand-wave algorithms.
  • transparentTransforms processing only works for the first mesh/transform for each name specified in the field, you can get around this by naming each mesh/transform uniquely. Will be fixed in next version in the next day or so as this is a bit of a game breaker for people wanting transparent windows.
  • In Editor (VAB/SPH) DepthMask shaders are disabled until I can figure out how to get the cameras setup. TransparentPod settings do work in the editor however, just not with the overlay meshes.

Changelog:

Spoiler

V0.1.24.0
Re-compile for KSP 1.12.x.
V0.1.23.0
Re-Compile for KSP 1.10.x.
V0.1.22.0
Re-Compile for KSP 1.9.x.
Portuguese Translations - thanks go to clustermage.
Added GameEvent JSIATPGameEvents.onATPResetIVA when JSIATP resets the IVA on a part.
Added GameEvent JSIATPGameEvents.onATPPodSettingChanged when the Pod setting is changed ON/OFF/AUTO by the user.

V0.1.21.0
Re-Compile for KSP 1.8.x.

V0.1.20.0
Re-Compile for KSP 1.7.x.

V0.1.19.0
Fixed issue with legacy transparent specular shader no longer available in KSP - causing some parts using this mod to appear with Pink (invalid) material/shader assignments.
Fix for Deepfreeze Mod Integration.

V0.1.18.0
Re-Compile for KSP 1.6.x.
Fix Camera HDR issue (thanks LinuxGuruGamer)

V0.1.17.0
Re-Compile for KSP 1.5.1.
Added German Localization (thanks Nils277)
Added Spanish Localization (thanks Fitiales)
Added Chinese Localization (thanks 6DYZBX)

V0.1.16.0
Re-Compile for KSP 1.4.1
V0.1.15.0
Re-Compile for KSP 1.3.1
V0.1.14.0
Re-Compile for KSP 1.3.0
Localization ready. Volunteers for translation gratefully accepted. :wink:
V0.1.13.0
Re-Compile for KSP 1.2.2
V0.1.12.0
Fix issue with use of the disableLoadingInEditor parameter.
V0.1.11.0
Re-Compile for KSP 1.2.1
V0.1.10.0
Fixed issue where Parts that are now considered "Plane" vessel type were being shown as transparentm (stock overlay) even if they were not
defined as JSITransparentPods. ie: Stock Plane Cockpits.
Removed all Linq (better performance and less garbage).
V0.1.9.0
Fixed issue where Part Triggers were being considered for blocking the Transparency of a part.
V0.1.8.0
Re-Compile for KSP 1.2
Changed Settings to use new Stock Settings Integration.
V0.1.7.0
Re-compile for KSP 1.1.3
V0.1.6.0
Fixed bug in TransparentTransforms processing for window shader swapping.  
V0.1.5.0
Fixed issue with Transparent shaders support for transparent Windows. 
Added check to part startup for fields stockOverlayDepthMaskShaderTransform & transparentPodDepthMaskShaderTransform if they cannot be found then processing is sped up (effiency change).
Added support for Internal Models defined to parts that have NO crew capacity at all. (Stock does not spawn or support internal models for parts that have no crew capacity defined, but that doesn't mean we can't do it, this mod now supports it).
Added bool field combineDepthMaskShaders. If this is set to True (Default is false) then the transparentPodDepthMaskShaderTransform is treated as an ADD_ON to the stockOverlayDepthMaskShaderTransform mesh. and BOTH will be turned on in JSIATP mode and the transparentPodDepthMaskShaderTransform will be turned off and the stockOverlayDepthMaskShaderTransform will be turned ON when in Stock overlay mode. This is to support different model configurations depending on what the modeller/modder requires. See WIKI for more details (added pictures to the WIKI as well).
WIKI updated with more details and examples.

V0.1.4.0
Compiled against KSP 1.1.2
Added swappable/multiple Depth Mask Shader support. See the WIKI page for details.
Automatically enable/disable the TransparentPod setting (part right click menu) if the IVA is obstructed by something else in front of it.
TransparentPod setting in the part right click menu will now display "Obstructed" in this scenario ONLY if it was set to "ON". If it is set to
"OFF" or "AUTO" it will remain locked in that state whilst obstructed.
Improved Portrait Camera handling.

V0.1.3.0 (now released as a seperate mod/repro from Raster Prop Monitor)
Fixed broken Transparent Shader and Opaque Shader swapping functionality.
Fixed camera jitters/lag on Transparent IVAs that are not part of the active vessel in flight.
Fixed Portrait Cameras when EVA from vessel.
Fixed ON/OFF/AUTO functionality in the Editor.
Opened settings var LoadedInactive to public so other mods can get it if they want it.
Public bool isIVAobstructed added to JSIAdvTransparentPod will be true if IVA attached to part is obstructed by another object in the foreground.

V0.1.2.0 (released under RPM V0.25.x)
Lots of bug fixes. Fix issues with portrait camera processing.
Fix bugs with settings file. Settings file now changed to default to show transparent pods on all loaded parts, and fixed logic for processing.

V0.1.1.0 (released under RPM V0.25.0)
JSITransparentPod is now obsolete (sorry for the short notice). Support for it has been removed from RasterPropMonitor.
To replace it, JSIAdvTransparentPod, in its own DLL, is now included in the RPM distribution.
The new module takes advantage of the stock cutaway functionality.

License: GNU GPLv3.
For a comprehensive version checking experience, please download the KSP-AVC Plugin

Source Code available on GitHub.

If you like my mods and you want to show your support, then you can support me on Patreon:
ZnlLmEw.png
Download

from SpaceDock, CurseForge or GitHub
SpaceDock runs and makes mods available to you based purely on donation. If you don't want to pledge to me at least
Consider pledging to keep SpaceDock going if you use it.  8VWCQzN.png

Support:

Be a :cool:COOL :cool:PERSON and help me by raising bugs and feature requests on GitHub here.

For support please ensure you are following these instructions.
From now on I will NOT respond to requests for support if you have not at least attempted to follow these simple steps.

NO LOG = NO SUPPORT.

When I ask for a LOG I mean this LOG:

 

KSP versions 1.8.0 and above:

  1. Windows: C:\Users\<username>\AppData\LocalLow\Squad\Kerbal Space Program\Player.log
  2. - This folder is usually hidden so you should enable the view hidden folders option (more information).
  3. Mac OSX: Open Console, on the left side of the window there is a menu that says 'files'. Scroll down the list and find the Unity drop down, under Unity there will be Player.log Aka Files>~/Library/Logs/Unity/Player.log
  4. Linux: The log is written to ~/.config/unity3d/Squad/Kerbal Space Program/Player.log


Whilst I agree CKAN is a great mod for those that can't use Zip tools. I take no part, nor am I interested in maintaining the CKAN mod metadata for my mods.
Please don't ask me about it but refer to the CKAN mod thread if you are having issues with CKAN or the metadata it maintains.

Author:

@JPLRepo : Plugin design and development, C# coding, Graphic design, 3D Models, textures, Implementation and releases.

Link to comment
Share on other sites

Looks interesting, @JPLRepo.  I suggest using the abbreviation JSIATP.

Could you add the version number to the name of the release zip file?  Like with the lastest RPM, "RasterPropMonitor.0.26.0.a.zip".  That way they'll each have a different name and I won't have to edit them to put in the version number manually. :)

JSI Advanced Transparent Pods still depends on RPM and requires RPM to work, correct?  So RPM has to be installed with it?  Mistaken, RPM not needed for JSIATP.

On the mods's wiki page, I think the path in this quote (bolded) wasn't updated from when it was included with RPM.  In the release .zip that file appears to now be at "GameData/JSI/JSIAdvTransparentPods/DisableTransparencyInEditor.cfg.noload".

Quote

although there is the Module Manager patch JSI/RPMPodPatches/DisableTransparencyInEditor.cfg.noload can be used to automatically apply the setting to every pod - simply remove the ".noload" from the end of the name.

How well do the stock parts meet the criteria you list on the wiki (quoted in the spoiler)?

Spoiler
Quote

A capsule properly designed for transparency must fit these criteria:

  • IVA and the outer model should match up strictly, which is apparently not the case for most pods. Props should not poke through the walls. (Unless they're using JSISelectivelyVisibleProp, at least.)
  • Props should not contain flat mesh colliders -- such objects when seen with a world-space camera cause Unity to spam error messages and cause a sharp drop in performance.
  • External windows must be specified as a transform of their own, so that their transparency can be manipulated if you so desire.
  • Windows must appear transparent (at least partially, or there's no point) with one shader and opaque with another shader. For example, they can have a texture with an alpha layer on the windows, and use KSP/Diffuse for opaque state while using KSP/Alpha/Translucent for transparent state. You can pick any pair of shaders, or even use one shader for transparent state and multiple others for opaque state, as long as this condition is satisfied, though.
  • You can specify transforms for internal windows in the transparentTransforms field and have their shaders swapped the same as the external windows.
  • The transparentTransforms field needs to be specified, or the windows will not properly switch to opaque if the user turns OFF the Transparent Pod feature via the right-click menu.
  • You need to add a copy of your external mesh onto your IVA with gaps in this mesh where you want your windows or where you want the user to see into your IVA from the outside. This mesh must be assigned the DepthShader in Unity 5 and exported as part of your IVA model.

 

In other words, how well would things work if I followed this:

Quote

The module strictly speaking requires no configuration:
MODULE { name = JSITransparentPod }

and use a Module Manager script to add it to every part that has an INTERNAL.  Like

@PART[*]:HAS[@INTERNAL[*],!MODULE[JSIAdvTransparentPod]]:NEEDS[JSIAdvTransparentPods]
{
	MODULE
	{
		name = JSIAdvTransparentPod
	}
}

(Technically that would add the MODULE to all parts with an INTERNAL that didn't already have it, so it would match non-stock parts too.  Not necessarily good.)

Edited by Jacke
Link to comment
Share on other sites

9 minutes ago, Jacke said:

Looks interesting, @JPLRepo.

Could you add the version number to the name of the release zip file?  Like with the lastest RPM, "RasterPropMonitor.0.26.0.a.zip".  That way they'll each have a different name and I won't have to edit them to put in the version number manually. :)

 

Why? - I don't understand why you are asking for this.
 

 

10 minutes ago, Jacke said:

 

On the mods's wiki page, I think the path in this quote (bolded) wasn't updated from when it was included with RPM.  In the release .zip that file appears to now be at "GameData/JSI/JSIAdvTransparentPods/DisableTransparencyInEditor.cfg.noload".

 

Thanks - Fixed.

15 minutes ago, Jacke said:

How well do the stock parts meet the criteria you list on the wiki (quoted in the spoiler)?

  Reveal hidden contents

 

In other words, how well would things work if I followed this:

and use a Module Manager script to add it to every part that has an INTERNAL.  Like


@PART[*]:HAS[@INTERNAL[*],!MODULE[JSIAdvTransparentPod]]:NEEDS[JSIAdvTransparentPods]
{
	MODULE
	{
		name = JSIAdvTransparentPod
	}
}

 

Why Don't you try it and find out. :cool:
Most will work... but I haven't tested them all. BEWARE: Doing so does not come for free performance-wise But you can use the ON/OFF/AUTO feature.
Warranty Void if you do do this though. :sticktongue:

Link to comment
Share on other sites

I also suggested "JSIATP" as an abbreviation for JSI Advanced Transparent Pods (in an edit I was doing as you were replying).

And JSI Advanced Transparent Pods still depends on RPM and requires RPM to work, correct?  So RPM has to be installed with it?

 

34 minutes ago, JPLRepo said:

Why? - I don't understand why you are asking for this. [ version number in .zip filename ]

Because a release zip file (or any other archive file format used for installation) should have the version number in its name.  If you just see "JSIAdvTransparentPods.zip", what version number is it?  If you download or copy the .zip file to the same location, that one file will be overwritten, preventing access to the older versions.  It's what's done by most other mods.  Take a look at RPM here, or Module Manager here.  They have their version numbers in their .zip filenames.  Ask @MOARdV how he does it with RPM.

 

Quote

Why Don't you try it and find out. :cool:

Most will work... but I haven't tested them all. BEWARE: Doing so does not come for free performance-wise But you can use the ON/OFF/AUTO feature.
Warranty Void if you do do this though. :sticktongue:

I will.  I'm aware doing such things can break stuff and will affect performance.  It's not my first rodeo. :)

Edited by Jacke
Link to comment
Share on other sites

42 minutes ago, Jacke said:

I also suggested "JSIATP" as an abbreviation for JSI Advanced Transparent Pods (in an edit I was doing as you were replying).

 

Because a release zip file (or any other archive file format used for installation) should have the version number in its name.  If you just see "JSIAdvTransparentPods.zip", what version number is it?  If you download or copy the .zip file to the same location, that one file will be overwritten, preventing access to the older versions.  It's what's done by most other mods.  Take a look at RPM here, or Module Manager here.  They have their version numbers in their .zip filenames.  Ask @MOARdV how he does it with RPM.

 

I will.  I'm aware doing such things can break stuff and will affect performance.  It's not my first rodeo. :)

That makes sense I guess. I will take that on board. As I use one IDE and distribution script for all my mods it will impact all of them but I guess it won't do any harm.

BTW: Yes if you apply that MM file it will modify ALL parts that have an Internal - Which SHOULD work fine. Basically they will all appear as they would if you toggle the new 1.1.x overlay feature on -but permanently.
If they don't have depth mask shader meshes then they will just appear exactly the same as they normally do. The code should handle it.

And it will allow more advanced mods/models support transparent windows only.

What will really blow everyone's mind is the next version which will allow for swappable meshes so that the part will appear with transparent Windows only or swap to a more wider transparent view (like the stock views).

24 minutes ago, RoverDude said:

Excellent that this is now separate :)

Yeah made sense to @MOARdV and I. Glad it makes sense to others as well.
BTW: The version 0.1.3.0 ONLY works in KSP 1.1.1 (makes use of the opened up lists in the KerbalPortraitGallery class - thanks to @NathanKell for opening them up.
If you want versions for KSP 1.1 or earlier you have to download earlier versions (that were distributed as part of RPM).
Looking to do an update very soon to allow swappable depth shader meshes. Say to have one mesh to have transparent windows only, or a more open/stock-a-like depth shader mesh, that swap either depending on a JSIATP setting or when you toggle stock overlay on and off. But still thinking about the best way to implement it.
Coming soon.

Edited by JPLRepo
Link to comment
Share on other sites

I have a bad habit of editing my posts just as someone is replying to them, so my last edit get missed.   My bad.

So as I mentioned in an edit, JSI Advanced Transparent Pods still depends on RPM and requires RPM to work, correct?  So RPM has to be installed with it?  Perhaps this should be noted on the original post.  Mistaken, RPM not needed for JSIATP.

1 hour ago, JPLRepo said:

[ versioned file names ] That makes sense I guess. I will take that on board. As I use one IDE and distribution script for all my mods it will impact all of them but I guess it won't do any harm.

Good good!

 

Quote

BTW: Yes if you apply that MM file it will modify ALL parts that have an Internal - Which SHOULD work fine. Basically they will all appear as they would if you toggle the new 1.1.x overlay feature on -but permanently.
If they don't have depth mask shader meshes then they will just appear exactly the same as they normally do. The code should handle it.

And it will allow more advanced mods/models support transparent windows only.

So this MM script is likely better, setting the mode to OFF initially on modded parts.

@PART[*]:HAS[@INTERNAL[*],!MODULE[JSIAdvTransparentPod]]:NEEDS[JSIAdvTransparentPods]
{
	MODULE
	{
		name = JSIAdvTransparentPod
		transparentPodSetting = OFF
	}
}

 

Quote

What will really blow everyone's mind is the next version which will allow for swappable meshes so that the part will appear with transparent Windows only or swap to a more wider transparent view (like the stock views).

....

Looking to do an update very soon to allow swappable depth shader meshes. Say to have one mesh to have transparent windows only, or a more open/stock-a-like depth shader mesh, that swap either depending on a JSIATP setting or when you toggle stock overlay on and off. But still thinking about the best way to implement it.
Coming soon.

Cool!  Looking forward to it!

Edited by Jacke
Link to comment
Share on other sites

32 minutes ago, Jacke said:

I have a bad habit of editing my posts just as someone is replying to them, so my last edit get missed.   My bad.

So as I mentioned in an edit, JSI Advanced Transparent Pods still depends on RPM and requires RPM to work, correct?  So RPM has to be installed with it?  Perhaps this should be noted on the original post.

RPM is NOT a requirement for this module to function.

Edited by JPLRepo
Link to comment
Share on other sites

 

42 minutes ago, JPLRepo said:

RPM is NOT a requirement for this module to function.

Good good.  Went back and editted my questions with strikethrough and added the answer no, so anyone reading won't get the wrong impression.

Went and did a quick check of the Mk1 Pod.  Here it is on the launchpad.  Looking the same as the stock Interior Overlay.

Spoiler

screenshot6a.png

And in the VAB, which stock KSP doesn't have.  Not surprising that a stock part with just my addition of the JSIATP MODULE isn't showing quite right.  The near side of the pod is still solid with only the nearest interior details visible.

Spoiler

screenshot3a.png

 

Link to comment
Share on other sites

6 hours ago, Jacke said:

 

Good good.  Went back and editted my questions with strikethrough and added the answer no, so anyone reading won't get the wrong impression.

Went and did a quick check of the Mk1 Pod.  Here it is on the launchpad.  Looking the same as the stock Interior Overlay.

  Reveal hidden contents

screenshot6a.png

And in the VAB, which stock KSP doesn't have.  Not surprising that a stock part with just my addition of the JSIATP MODULE isn't showing quite right.  The near side of the pod is still solid with only the nearest interior details visible.

  Reveal hidden contents

screenshot3a.png

 

Yep VAB will be a bit messed up because of the way the cameras are set up. But in flight should be ok on stock parts.

Link to comment
Share on other sites

55 minutes ago, JPLRepo said:

Yep VAB will be a bit messed up because of the way the cameras are set up. But in flight should be ok on stock parts.

That's what I found too.  However, even in the VAB, you do get something.  Besides the slightly exploded view of the pod, if you can explicitly move the camera inside, you don't just see a ghost outline around you like in stock, but the proper IVA INTERNAL.  Very cool! :)

Link to comment
Share on other sites

Support for JSI Adv Transparent Pods (windows only transparency) and Stock Overlay (more cut-away view of the IVA) is under way.
Proof of concept pics:

Spoiler

Standard Transparent pod with Pod setting to OFF (windows Opaque)

DrLq9dB.png

 

Same pod with Transparent Pod setting to ON (windows transparent)

14XRcFz.png

Same pod but with the Stock Overlay Cam turned on (large cut-away mode):
BYbB3Od.png

 

 

 

 

Edited by JPLRepo
Link to comment
Share on other sites

8 hours ago, Stone Blue said:

Hmmm... @JPLRepo any idea if the WindowShine mod would work with the (windows transparent) ON?...

No idea. I've never looked at it until now. and it hasn't been updated to 1.1 yet. When it is I'll take another look.

Link to comment
Share on other sites

Released version 0.1.4.0. Compatible with KSP 1.1.2 (should work in 1.1.1?, but why bother).
Added swappable/multiple Depth Mask Shader support. See the WIKI page for details.
Automatically enable/disable the TransparentPod setting (part right click menu) if the IVA is obstructed by something else in front of it.
TransparentPod setting in the part right click menu will now display "Obstructed" in this scenario ONLY if it was set to "ON". If it is set to "OFF" or "AUTO" it will remain locked in that state whilst obstructed.
Improved Portrait Camera handling.

Link to comment
Share on other sites

Awesome mod I truly love it, it makes my station POP!!! LOL.
So I love the look of those pods in the cover art. I know the left is from Planetary Base Systems and the right is from the space tug (Both great mods), but where do the center 2 come from?

Link to comment
Share on other sites

 

27 minutes ago, Steel Dragon said:

Awesome mod I truly love it, it makes my station POP!!! LOL.
So I love the look of those pods in the cover art. I know the left is from Planetary Base Systems and the right is from the space tug (Both great mods), but where do the center 2 come from?

From my DeepFreeze mod. See Sig for link.

1 hour ago, Nansuchao said:

You're incredible JPLRepo, you updated all of your mod in less than a day. 

You deserve a distinct place in the Olympus of KSP modders!

I wish. But I still have 3 of my mods stuck in KSP 1.0.5-land. working on rectifying that...

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