KSP3DRings

Puts 3D rocks into Kopernicus rings when you fly through them. Rocks orbit at the real speed for
their radius (inner rows faster), so burning actually moves you relative to them. The ring itself
stays Kopernicus' own flat textured mesh, faded out when you are inside the ring; the rocks are drawn on top of it.

Needs Kopernicus. Windows x64 only for now (the native lib and shader bundle are windows builds).

INSTALL
Put the KSP3DRings folder in GameData. Every Kopernicus ring is found automatically, nothing to list.
Rock density follows the ring texture: dense bands get a lot, gaps get none.

FILES
Plugins/Meisol.Rings.dll        plugin
Plugins/meisol_rings.native     C++ lib, it's a renamed dll so KSP doesn't try to load it as an assembly
Shaders/meisol-rings-windows.unity3d    rock shaders
Rings.cfg                       settings

SETTINGS
Everything is optional and lives in MEISOL_VISUALS { RINGS { ... } }. Defaults in brackets.

  enabled, rocks, rockShadows [true]   switch the whole thing, the rocks, rock shadows
  meshFade [true]        fade Kopernicus' flat ring mesh by distance from you: clear close by, full a few tens of km out (times the planet
                         factor), so inside the ring it is not a hard-edged band along the horizon. Kopernicus/Rings rings fade
                         through the shader's own fadeoutStartDistance / fadeoutStopDistance (lighting and planet shadow unchanged,
                         never weaker than the pack's own fade); Unlit/Transparent rings are swapped to an unlit fading copy. Any
                         other ring shader is left as Kopernicus draws it and KSP.log says "ring mesh uses shader X, fade skipped".
  rockCull [true]        only lay out rock cells the camera can see (bands that cast no shadow). Output is the same, it
                         trades about 0.15 ms of cpu for fewer instances on the gpu. Turn it off if you are cpu bound.
  bench [false]          set true, fly into a ring, hold still ~35 s: it times 4 setups for 4 s each (all on, no rocks,
                         no rock shadows, no cull) and writes the table to the log, then turns itself off
  rockDensity [1]        rocks per cell multiplier, 0-5
  rockThickness [1]      how far the rocks spread above/below the plane, 0.1-10
  sizeScale [1]          rock size multiplier, 0.1-10 (rocks are 0.08 m to 160 m before scaling)
  sizeRef [6000000]      planet radius in m the rock field is tuned for (a stock Jool). A bigger planet (real scale) scales
                         the field up by radius / sizeRef, up to 30x, never below 1x. 0 turns the scaling off.
  scaleExp [1.5]         how the field (rock sizes, spacing, reach, fades) grows with the planet: the factor above to this
                         power. 1 = in step with the radius, 1.5 = a bit more, so a big planet's rings can be seen from a long
                         way off. 0 = no growth (stock sizes). The rocks are drawn by the main flight camera only, so
                         they stop at its far clip plane (1875 km in KSP 1.13).
  dustRange [60000]      how far past the ring edges the field stays on, in m (times the planet factor; never less than 270 km)
  activeHeight [60000]   field switches off this far above the plane, in m (same)
  coMove [false]         field follows your ship's speed instead of the real orbital rate
  coMoveSeconds [5]      how fast it matches your ship when coMove is on

  The old dust sheet is gone. Its keys (dust, dustOpacity, dustFraction, dustMaxOpacity, maxOpacity, sheetSigma, dustSigma,
  layerEdgeOpacity, layerFaceOpacity, dustSteps, wakeScale, haze, bandFloor, bandBoost, nearMiss) are still
  accepted so an old Rings.cfg loads, and do nothing.

LIVE SWITCHES
In flight: Home = rocks, Insert = rock shadows, PageUp = rock culling, End = the ring mesh fade. Each flips on or off, with a
message on screen and a "key:" line in the log. Not saved.

PER RING
RING blocks change the look of one ring. They never add or remove a ring.

  RING
  {
      body = Sannah
      innerKm = 2754      // only needed to pick one ring when a planet has several, matches within 5% or 5 km
  }

No innerKm means every ring on that body.

FOR MOD AUTHORS
You don't need a patch, just ship your own node. All MEISOL_VISUALS nodes in the game get merged:

  MEISOL_VISUALS:NEEDS[Meisol.Rings]
  {
      RINGS { RING { body = MyPlanet } }
  }

RING blocks from every file are collected. If two hit the same ring they apply in load order and the
later key wins. Same for global keys, so don't set those from a planet mod unless you mean to.
NEEDS[KSP3DRings] only works if MM counts this folder, NEEDS[Meisol.Rings] (the dll name) always does.

LOG
Look for [Rings] in KSP.log. It says which rings it found, whether the native lib and shaders loaded,
each camera's clip range, and logs any native call that failed. If the lib or shaders are missing it
logs why and turns itself off.
