- Home /
Ortho-Isometric camera not playing nice with culling
Hi all! This is my first post here. With that said, Unity Answers has been extremely helpful in the past, so I'm hoping it will be again :D
My game is 2.5D using Unity's terrain. I am using an orthographic camera that is rotated 30 degrees on the X axis, and 45 degrees on the Y axis. This camera follows the player using a tracking script, which offsets the camera from the player ...
*30 units on X and Z. *24 units on Y.
... to center the player in the frame.
The camera was originally offset to 15x, 12y, 15z from the player which was much closer, but I had issues with the camera clipping near on hilly terrain. I adjusted those values to raise the camera a bit higher and solve that.
The problem I am having now, is that the camera doesn't seem to be culling things in the frame properly, or in the proper order. Here's an example:
Notice how the objects closer to the camera (bottom of frame) are getting their real-time shadows from the sun, whereas the objects farther from the camera (at the top of the frame) have no shadows and are beginning to have their LOD applied.
I have also noticed that if I run the game on a lower quality setting and zoom the camera all the way out, real-time shadows appear on objects that are about 3/4 of the way down in the frame. They fade out if the objects are anywhere in the middle of the frame. Objects in the top of the frame have effects culled completely. If I zoom the camera in just a little on lower settings, it's not possible to see ANY real-time lighting. It is almost as if Unity does not quite know where camera-center is, and is trying to focus rendering on some point directly under the camera even though that is not even remotely where the camera is facing.
So, my question is, how can I fix or work around this?
EDIT: Forgot to mention, it culls grass in the same fashion, which is quite ugly when the player is running up a hill towards the camera.
Answer by tw1st3d · Aug 18, 2013 at 01:31 PM
You need to change your Shadow Distance property in Edit->Project Settings->Quality
Thanks for replying tw1st3d, but I don't think that's the fix. All that would do is decrease performance. It's a solution for one of the symptoms, but I don't think it's a solution for the actual problem.
Also forgot to add, my Shadow Distance on 'Fantastic' quality is already set to 150. This is occurring even with that.
The only other thing I can think of, is the camera being rotated at the angle it is. I've noticed when my camera is turned in certain angles, my lighting messes up.
Hrm... perhaps I will need to change the angle to something more 'top-down' to resolve this. I'd really hate to do that because the game is designed around this perspective, but there seems to be no other option aside from going top-down or having almost entirely flat terrain (so the offsets can be much smaller.)
Your answer
Follow this Question
Related Questions
How to make an Isometric and Orthographic camera? 2 Answers
Limiting orthographic camera to only rendering specific objects without using layers 0 Answers
I need no perspective distortion for some part of screen 0 Answers
Center Object in Viewport 1 Answer
Constrain a GameObject's movement to an orthographic camera's viewport bounds 4 Answers