mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
fix inner fog yay
This commit is contained in:
parent
745a776182
commit
a12ba1f466
@ -9,9 +9,6 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class WaterBuilder
|
||||
{
|
||||
private static readonly int Radius = Shader.PropertyToID("_Radius");
|
||||
private static readonly int Radius2 = Shader.PropertyToID("_Radius2");
|
||||
|
||||
public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
|
||||
{
|
||||
var waterSize = module.size;
|
||||
@ -116,8 +113,8 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
else
|
||||
{
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat(Radius, module.size);
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat(Radius2, module.size / 2f);
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius", module.size);
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius2", 0);
|
||||
}
|
||||
|
||||
// TODO: fix ruleset making the sand bubble pop up
|
||||
|
||||
@ -5,16 +5,17 @@ namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
public Material oceanFogMaterial;
|
||||
|
||||
private const float oceanFogR1Ratio = 1f;
|
||||
private const float oceanFogR2Ratio = 0.5f;
|
||||
private void Awake()
|
||||
{
|
||||
oceanFogMaterial.SetFloat("_Radius2", 0);
|
||||
}
|
||||
|
||||
protected new void FixedUpdate()
|
||||
{
|
||||
base.FixedUpdate();
|
||||
if (oceanFogMaterial)
|
||||
{
|
||||
oceanFogMaterial.SetFloat("_Radius", oceanFogR1Ratio * CurrentScale);
|
||||
oceanFogMaterial.SetFloat("_Radius2", oceanFogR2Ratio * CurrentScale);
|
||||
oceanFogMaterial.SetFloat("_Radius", CurrentScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user