Jump to content

How to suppress the stock areo visuals for a holographic Unity LineRenderer?


Recommended Posts

We have a reported bug in kOS that I have no idea how to go about fixing. The bug report is here, along with a picture:

https://github.com/KSP-KOS/KOS/issues/1096#issuecomment-120767897

The visual effects that stock KSP does for going fast in atmosphere, the burning and the shockwaves, are being applied to some of our objects that are meant to be entirely holographic visual aids and not really "there" in the game world. These objects are not 2D GUI items glued to the screen, but are simply 3D rendered semitransparent Unity primitives that lack colliders so they normally don't do any interactions with the world. Specifically they are LineRenderer objects, used to draw vectors in 3D space.

The stock game appears to be drawing areo effects for all Unity 3D primitives in the game, regardless of whether they are physically interacting with things (have colliders) or are purely holographic (have no colliders). Since these are NOT classes that KSP themselves invented, but are just low level Unity primitives (LineRenderer) I don't expect them to contain any members, be they properties or fields or methods, that I can use to turn the effect off for them. The effect is something SQUAD invented, so I don't expect it to be mentioned on a stock Unity class like LineRenderer.

How the heck do I suppress the effect for these objects?

It's not breaking anything, as it's purely a visual effect only, but it looks really wrong.

Link to comment
Share on other sites

You need to change the gameobject layer.

gameObject.layer = 15;

Thanks, I'll give that a try.

I really wish SQUAD had used an enum or mnemonic constant integers for the layer numbers, to make it clear how they meant for them to be used, so instead of saying "15" you could say "UI_LAYER" or some such. You could then also get a listing of all the layer numbers and what they mean, instead of having to rely on the modder community reverse-engineering what they are.

Link to comment
Share on other sites

  • 2 weeks later...

Some info here that may prove useful:

http://forum.kerbalspaceprogram.com/threads/93417-Unity-Layers-and-Tags

Would be worth going through again and starring a new thread, thinking about it. That info is a little old, and Spanner has not been seen for some time. I found NoAttach by recursing through a stock cargo bay and dumping the layer and tag info for each GO. If parts are selected carefully, a complete list may be possible

Link to comment
Share on other sites

I found NoAttach by recursing through a stock cargo bay and dumping the layer and tag info for each GO. If parts are selected carefully, a complete list may be possible

Looks like the complete list of part tags has already been found ... at least, those in use

Layer 0: Default
Layer 1: TransparentFX
Layer 2: Ignore Raycast
Layer 3:
Layer 4: Water
Layer 5: UI
Layer 6:
Layer 7:
Layer 8: PartsList_Icons
Layer 9: Atmosphere
Layer 10: Scaled Scenery
Layer 11: UI_Culled
Layer 12: UI_Main
Layer 13: UI_Mask
Layer 14: Screens
Layer 15: Local Scenery
Layer 16: kerbals
Layer 17: Editor_UI
Layer 18: SkySphere
Layer 19: Disconnected Parts
Layer 20: Internal Space
Layer 21: Part Triggers
Layer 22: KerbalInstructors
Layer 23: ScaledSpaceSun
Layer 24: MapFX
Layer 25: EzGUI_UI
Layer 26: WheelCollidersIgnore
Layer 27: WheelColliders
Layer 28: TerrainColliders
Layer 29: DragRender
Layer 30: SurfaceFX
Layer 31: Vectors

// Parts
Tag: Airlock
Tag: Icon_Hidden
Tag: Icon_Only
Tag: Ladder
Tag: NoAttach
Tag: Untagged // could be used by other than parts

// misc
Tag: MainCamera
Tag: LaunchpadFX

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