Bramble Fixes (#733)

<!-- Be sure to reference the existing issue if it exists -->
## Bug fixes
- Fixed a bug where fog preview lights were being affected too much by
node scaling (cause of #574)
- Fixed an issue where fog of bramble nodes was being double scaled
(maybe caused by c9ee5ec1ac38a7ad9b5b9c4c7329ec526bf8cace)

I included a planet folder that adds a little node orbiting DB. That
node should be able to demonstrate the old & new behaviors.

[planets.zip](https://github.com/Outer-Wilds-New-Horizons/new-horizons/files/12629245/planets.zip)
This commit is contained in:
Nick 2023-09-27 13:21:20 -04:00 committed by GitHub
commit 23b41ebf42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,7 +235,11 @@ namespace NewHorizons.Builder.Props
// account for scale (this will fix the issue with screen fog caused by scaled down nodes) // account for scale (this will fix the issue with screen fog caused by scaled down nodes)
// Set the main scale // Set the main scale
brambleNode.transform.localScale = Vector3.one * config.scale; // Can't just use localScale of root, that makes the preview fog lights get pulled in too much
foreach(Transform child in brambleNode.transform)
{
child.localScale = Vector3.one * config.scale;
}
innerFogWarpVolume._warpRadius *= config.scale; innerFogWarpVolume._warpRadius *= config.scale;
innerFogWarpVolume._exitRadius *= config.scale; innerFogWarpVolume._exitRadius *= config.scale;
@ -259,7 +263,7 @@ namespace NewHorizons.Builder.Props
// (it's also located on a different child path, so the below FindChild calls wouldn't work) // (it's also located on a different child path, so the below FindChild calls wouldn't work)
// Default size is 70 // Default size is 70
var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere"); var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere");
fog.transform.localScale = Vector3.one * config.scale * 70f; //fog.transform.localScale = Vector3.one * config.scale * 70f; This is already scaled by its parent, don't know why we scale it again
// Copy shared material to not be shared // Copy shared material to not be shared
var fogRenderer = fog.GetComponent<MeshRenderer>(); var fogRenderer = fog.GetComponent<MeshRenderer>();