Quantcast
Channel: Answers by "lodendsg"
Viewing all articles
Browse latest Browse all 102

Answer by lodendsg

$
0
0
KaletheQuick's reply is a solid answer if your game has a single scale e.g. if you only ever play from a very far distance camera view. We are also working on a space game and have need of very long distance views but we also needed a rather close nearly 'human perspective' view as KaletheQuick called it. To achieve this we use layered cameras, note that in Unity you can discribe the order in whcih your cameras will render and what objects (layers) it will render. In our case for example we have UI, Near, Far and Back we also have 4 cameras that coraspond to thouse each camera renders only the objects on its respective layer and has a resonable clip distance with a total range less than 1000 units anything more than this and you will see shadow flicker. Next we have our scene split up such that objects on the 'Back' are scaled similar to the 1 unit = 1 AU range Near uses 1 = 10m and Far uses a 1 = 100000m. Far camera moves at a rate scaled to Far camera e.g. when Near moves 1unit Far moves 1/10000 units ... in our case Back camera is fixed e.g. it never moves only maps rotation like a skybox camera would. The ranges you use will depend on your game ... in our case we know no object will transition from Near to Far or Far to Near without the player 'warping' which means we can use the warp effect to hide the transition. Few notes about this method ... shadows cannot cross cameras e.g. an object rendering on Far will not cast shadow on an object in the Near ... there are a few situations where you might need an object to do this and you can use the Shadow Only option of Mesh Renderer to suit these situations in most cases. As I recall Kerbal Space accadamy used a similar method and had a talk on it at a GDC or a Unite session though I cant recall which nor can I find it on YouTube at the moment. The point being to use a variable scale and multiple cameras to achieve both a high detailed near by view and a long distnace view with the draw back that objects cannot enteract between the near and far views without some special trickery depndent on your game.

Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>