Friday, October 28, 2022
HomeGame DevelopmentDisplay screen splitted in several areas, every with a unique scene in...

Display screen splitted in several areas, every with a unique scene in Unity


That is simple to realize with viewports.

Contained in the Inspector settings on the Digicam part, you may discover a part labelled “Viewport Rect” that defines the rectangle on display that this digital camera ought to render to.

The default worth is {x: 0, y: 0, w: 1, h: 1} which suggests “begin within the bottom-left nook (0, 0) and occupy 100% of the width and top”. Altering these 1s to 0.25 would make the digital camera render to only one quarter of the display, and hanging the 0s would transfer the place that quarter-screen pane sits throughout the wider display (or window).

So: give every “scene” you need to render its personal digital camera, with completely different viewport rectangles every. That can get your break up display rendering taken care of.

You may creator every of those 4 panes in a separate scene file if you happen to like, and once you begin the sport, load all 4 scenes collectively utilizing LoadSceneMode.Additive to stack the scenes up within the present state, quite than unloading the earlier scene earlier than loading the following.

This overlaps all scenes in a single world coordinate area, so you may need to creator them so they do not intervene with one another. I might advocate inserting them in distinct areas of the world coordinate system (not too removed from the origin), in order that once you view them within the scene view whereas testing you’ll be able to see and choose content material from every one with out confusion. You can even use Layers to filter content material, so cameras in a single scene do not see content material loaded from one other, and so physics objects in a single do not intervene with one other.

You may talk between these scenes with a static supervisor script. Or you’ll be able to creator a few of them that have to be tightly linked (just like the 3D scene and its 2D map) in a single scene file to make it simple to wire up references between them (although you’ll be able to nonetheless save every model of the scene as its personal prefab if you happen to additionally like working with them as separate recordsdata at different instances).

You might even make this with a single copy of the 3D area rendered from two views by two cameras, utilizing layer and shader methods to make the 2D map digital camera render it the way in which you need without having to creator an entire second copy of the area. This may prevent from bugs that come up once you change one thing in a single model of the scene and neglect to make precisely the identical change in its counterpart.

Or, one other manner you’ll be able to assault this, since all of your different “scenes” are 2D, is to make use of the UI system. You may render your 3D scene to 1 nook with a viewport as defined above, then put your different 4 views right into a UI Canvas set to Screenspace Overlay mode, so it attracts over the entire display in any case cameras have rendered.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments