Error node.m_Bounds.IsValid() on UnityEngine.Camera:Render()

Hello,

I'm getting this strange error at times...

Let me try to explain the setup...

There are three cameras set to render to texture. These cameras receive their render targets from a C# script.

Up until here it works.

The cameras are disabled, and told to render manually every half second or so. This is done in a coroutine that runs in a constant loop, updating the camera's position and rotation, rendering it, and yielding for the given amount of time, like this:

while(running)
{
    updateCamera();
    cameraRef.Render();
    yield return new WaitForSeconds(interval);
}

Ok, so what happens is that at given moments in the game (namely, when the player's ship explodes), the game will occasionally halt and produce that error message.

The trace points to the cameraRef.Render() line... which really isn't very informative...

The cameras have their transform updated based on values grabbed off the ship... so I was thinking that upon explosion, some values might become messed up (the ship isn't deleted when it explodes, it's just disabled)... So I commented out the cameraUpdate() call, which is where all the updation happens... No dice, it still fails occasionally when the ship explodes...

I'm starting to think it might somehow be related to the explosion effects themselves... the explosion effects are driven by the Detonator framework, and in fact, are just the default explosions that come with it... It sounds far fetched... but I don't know what to think anymore...

The texture cameras are set to cull every layer except one, and that doesn't include the explosions...

Any thoughts?

One more thing, which may or may not be related... If instead of manually rendering the camera, I just enable it from start and leave it to render by itself, I get another error saying screencoords[0] < 0 || screencoords[1] < 0 ...that happens right on pressing play...

Thanks in advance for any (really, any) help!!

Cheers

Hmm ok, I did some more testing...

It's definitely related to Detonator.

I commented out the call that spawns the explosion, and now there are no more occasional errors.

Granted, there are no more explosions either... but at least I've found the cause.

Hmm, now I guess it's down to editing Detonator's effects to see what exactly is causing it... I suspect that heatwave effect, which is a post-process shader thing... it might be somehow affecting the render cams, even though they're not supposed to render it.

Well, let's see what happens.

Cheers


Another follow up:

Very odd, but changing that render line to cameraRef.RenderDontRestore() apparently did something...

I exploded the ship a lot of times, trying to get that error to show again... It did once, but didn't halt the game... 30 crashes later, I couldn't reproduce the error again...

weird... very weird...

Cheers