Hey,
I just started using Unity and was going through the documentation. Most of it is pretty simple but I had a few questions about the camera…
First of all, when I set a camera’s clear flag to “Don’t Clear” doesn’t that mean that the camera draws over all cameras with a lower depth without clearing anything (behavior shown by “Depth Only”). I’m actually getting quite the opposite effect with “Don’t Clear”. I was wondering if somebody could give a technical explanation of what this option actually does…
Secondly, (this is more of an observation rather than a question), when setting the normalized viewport, it seems that the clipping plane of the camera is automatically adjusted since there is no distortion. Normally, you’d expect some distortion to occur when the aspect ratio of the view plane and the camera’s clipping plane isn’t the same.
Now I think about it, I can’t off the top of my head think of a use for setting Don’t Clear, as it seems to create a HOM effect (I suppose handy if you wanted to create an accurate Doom clone? lol).
What do you mean by ‘opposite effect’? Your description sounds more or less correct to me (other than that I’m not sure what you mean by ‘behavior shown by “Depth Only”’). Cameras are rendered in order based on their depth value (low to high), and ‘don’t clear’ means that neither the color or depth buffer is cleared (which is basically what you said).
You won’t necessarily get a hall-of-mirrors effect with the ‘don’t clear’ settings; it just depends on what’s been rendered prior to the camera in question rendering.
As for when you might use ‘don’t clear’, there are various effects for which it can be useful. For example, if you wanted to render some sort of custom UI layer using shaders with no depth writing or testing, you might use the ‘don’t clear’ option.