Question by
metaman · Aug 31, 2020 at 10:39 PM ·
memory-leakmemory usage
How do I fix hundreds of render textures sitting in memory without creating them?
I am having a problem where every time I run my project more of these InScatteredRadianceTables are added to memory until Unity crashes, I have no idea why this is happening as I dont use render textures anywhere in my project except for reflection probes & planar reflection probes. I believe the problem is possibly related to this camera collision script
public float minDistance = 1.0f;
public float maxDistance = 4.0f;
public float smooth = 10.0f;
Vector3 dollyDir;
public Vector3 dollyDirAdjusted;
private float distance;
// Use this for initialization
void Awake()
{
Resources.UnloadUnusedAssets();
dollyDir = transform.localPosition.normalized;
distance = transform.localPosition.magnitude;
}
// Update is called once per frame
void Update()
{
Vector3 desiredCameraPos = transform.parent.TransformPoint(dollyDir * maxDistance);
RaycastHit hit;
if (Physics.Linecast(transform.parent.position, desiredCameraPos, out hit))
{
distance = hit.distance -0.1f;
}
else
{
distance = maxDistance;
}
transform.localPosition = Vector3.Lerp(transform.localPosition, dollyDir * distance, Time.deltaTime * smooth);
}
}
as the problem only started to appear after I added it, but again I cant see how as it dosent reference any render textures. For context I am using HDRP and Unity 2019.3.0f6.
Any help would be much appreciated.
rendertexquestion1.jpg
(172.4 kB)
Comment