This commit is contained in:
Nick 2022-07-24 23:53:53 -04:00
commit fe8038d1c7
4 changed files with 18 additions and 20 deletions

View File

@ -53,9 +53,11 @@ jobs:
path: xen.NewHorizons
- name: Zip Asset
uses: montudor/action-zip@v1
with:
args: zip -qq -r xen.NewHorizons.zip xen.NewHorizons/*
run: |
cd xen.NewHorizons/
zip -r xen.NewHorizons.zip *
mv xen.NewHorizons.zip ..
cd ..
- name: Upload Asset
uses: ncipollo/release-action@v1

View File

@ -30,18 +30,18 @@ namespace NewHorizons.Builder.Atmosphere
atmo.transform.localScale = Vector3.one * atmosphereModule.size * 1.2f;
var renderers = atmo.GetComponentsInChildren<MeshRenderer>();
var sharedMaterial = new Material(renderers[0].material);
foreach (var meshRenderer in renderers)
var material = renderers[0].material; // makes a new material
foreach (var renderer in renderers)
{
meshRenderer.sharedMaterial = sharedMaterial;
renderer.sharedMaterial = material;
}
sharedMaterial.SetFloat(InnerRadius, atmosphereModule.clouds != null ? atmosphereModule.size : surfaceSize);
sharedMaterial.SetFloat(OuterRadius, atmosphereModule.size * 1.2f);
if (atmosphereModule.atmosphereTint != null) sharedMaterial.SetColor(SkyColor, atmosphereModule.atmosphereTint.ToColor());
material.SetFloat(InnerRadius, atmosphereModule.clouds != null ? atmosphereModule.size : surfaceSize);
material.SetFloat(OuterRadius, atmosphereModule.size * 1.2f);
if (atmosphereModule.atmosphereTint != null) material.SetColor(SkyColor, atmosphereModule.atmosphereTint.ToColor());
atmo.SetActive(true);
Skys.Add((planetGO, sharedMaterial));
Skys.Add((planetGO, material));
}
atmoGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero);

View File

@ -61,25 +61,21 @@ namespace NewHorizons.Components
if (_stars.Count > 0) ChangeActiveStar(_stars[0]);
else gameObject.SetActive(false);
foreach (var atmo in AtmosphereBuilder.Skys)
foreach (var (_, material) in AtmosphereBuilder.Skys)
{
var shader = atmo.Item2;
shader.SetFloat(SunIntensity, 0);
material.SetFloat(SunIntensity, 0);
}
return;
}
// Update atmo shaders
foreach (var atmo in AtmosphereBuilder.Skys)
foreach (var (planet, material) in AtmosphereBuilder.Skys)
{
var planet = atmo.Item1;
var shader = atmo.Item2;
var sqrDist = (planet.transform.position - _activeStar.transform.position).sqrMagnitude;
var intensity = Mathf.Min(_activeStar.Light.intensity / (sqrDist / hearthSunDistanceSqr), 1f);
shader.SetFloat(SunIntensity, intensity);
material.SetFloat(SunIntensity, intensity);
}
foreach (var star in _stars)

View File

@ -34,8 +34,8 @@ Check the ship's log for how to use your warp drive to travel between star syste
- Separate solar system scenes accessible via wormhole OR via the ship's new warp drive feature accessible via the ship's log
- Remove or edit existing planets, including what they orbit around
- Create custom planets from heightmaps/texturemaps
- Create stars (and supernovae), comets, asteroid belts, satellites, and quantum planets/moons.
- Add stock planet features to custom ones, such as geysers, cloak fields, meteor-launching volcanoes, rafts, and tornados.
- Create stars (and supernovae), comets, asteroid belts, satellites, quantum planets/moons, and custom Dark Bramble dimensions.
- Add stock planet features to custom ones, such as geysers, cloak fields, meteor-launching volcanoes, rafts, tornados, and Dark Bramble seeds/nodes.
- Binary orbits
- Signalscope signals and custom frequencies
- Surface scatter: rocks, trees, etc, using in-game models, or custom ones