fix inner fog yay

This commit is contained in:
JohnCorby 2022-05-24 22:44:31 -07:00
parent 745a776182
commit a12ba1f466
2 changed files with 7 additions and 9 deletions

View File

@ -9,9 +9,6 @@ namespace NewHorizons.Builder.Body
{ {
public static class WaterBuilder 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) public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
{ {
var waterSize = module.size; var waterSize = module.size;
@ -116,8 +113,8 @@ namespace NewHorizons.Builder.Body
} }
else else
{ {
fogGO.GetComponent<MeshRenderer>().material.SetFloat(Radius, module.size); fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius", module.size);
fogGO.GetComponent<MeshRenderer>().material.SetFloat(Radius2, module.size / 2f); fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius2", 0);
} }
// TODO: fix ruleset making the sand bubble pop up // TODO: fix ruleset making the sand bubble pop up

View File

@ -5,16 +5,17 @@ namespace NewHorizons.Components.SizeControllers
{ {
public Material oceanFogMaterial; public Material oceanFogMaterial;
private const float oceanFogR1Ratio = 1f; private void Awake()
private const float oceanFogR2Ratio = 0.5f; {
oceanFogMaterial.SetFloat("_Radius2", 0);
}
protected new void FixedUpdate() protected new void FixedUpdate()
{ {
base.FixedUpdate(); base.FixedUpdate();
if (oceanFogMaterial) if (oceanFogMaterial)
{ {
oceanFogMaterial.SetFloat("_Radius", oceanFogR1Ratio * CurrentScale); oceanFogMaterial.SetFloat("_Radius", CurrentScale);
oceanFogMaterial.SetFloat("_Radius2", oceanFogR2Ratio * CurrentScale);
} }
} }
} }