|
I'm playing with a hack of the Island Demo that has me more or less looking at the world through a real-time cubemap. I just noticed that objects like the palm trees seem to rapidly narrow themselves into invisibility past a certain distance. For instance, I can back away from the beach up a mountain path and at some point each tree-cluster individually will start rapidly shrinking on x and/or z while retaining its proper-for-distance height, before popping out entirely. The cubemap camera is set to the same clipping depth as my main camera (2000), and yet the main camera renders fine from the same position. I could see this being a Unity optimization to discreetly reduce the amount of content rendered to cubemaps. I could also see it being a bug in the cubemap render transforms that hasn't been caught because most folks aren't pathological enough to be using a real-time cubemap as their primary view of a world. Anyone have any idea what's up?
(comments are locked)
|
|
Hm. Suspicions confirmed- the objects are flattening themselves to bilboard against the heading of the rendering camera. Popping a cam.transform.rotation tweak into the UpdateCubemap function:
seems to eliminate the visible symptom (yeah, there are some extra commented-out lines in there that I was playing with to solve ~other~ issues). I'm still curious as to why the engine does this to begin with, and whether it happens on all renders or just cubemap renders... Er... this solves it for ~my~ purposes, anyway. It won't help if your environment map needs to be correct from any angle when seen from any angle.
May 11 '10 at 06:40 PM
sean
The terrain engine flattens trees to billboards at a certain distance because otherwise you'd have 50 gazillon polygons being drawn, which would not really be acceptable.
May 11 '10 at 07:42 PM
Eric5h5
Figured it was that or depth buffer disambiguation. Still, the fact that it billbaords against camera object heading even for the non-front sides of cubemaps seems like a glitch. This may not be the 'right' answer, but what would happen if they billboarded against the cameraPos->objectPos vector?
May 12 '10 at 02:21 PM
sean
(comments are locked)
|

To reproduce: In the Island Demo, try putting the Reflective Bumped Unlit shader on a flat plane in front of the camera and adding the real-time cubemap script from the manual (disable the water layer from the script's rendering set, and up the cubemap resolution to at least 512 if you can). This will give you a rear-view-mirror. Cross the bridge and continue down the path to the heron beach and hang a right up the mountain. Keep an eye on the trees behind you as you walk up- past a certain point they will very clearly flatten themselves along a horizontal axis...