Game Development Reference
In-Depth Information
Going deep
So far in both modes of the Screen Space Canvases, we dealt with a UI that was
being drawn relative to the entire drawing space of the screen; each of the modes is
intended to draw over or against the full screen.
However, in a lot of cases, this is not the desired effect. We want our UI to draw
on surfaces, pop up message boxes within (not on) a scene, or even hover over the
shoulder of a third-person character (as shown in the aforementioned inventory
panel used in games such as Dead Space).
A lot of this is possible today, either using render textures (which require the pro
version of Unity), twisting the legacy GUI through code (not very pretty), or using
shaders in an intrinsic way (requiring an in-depth knowledge of shaders). All of
these are usually outside the comfort zone for beginners or require a lot of time to
set up and get right. This is where the new World Space Canvas comes in.
Hang your Canvas wherever you like
With the World Space Canvas , you literally get to take your UI canvas and place it
where you want, positioned where you want, and rotated however you like, fully
within a 3D environment. Unlike the Screen Space Canvases, they are not limited in
any way. In fact, a World Space Canvas acts almost entirely the same as a Render
Texture but without the limitation of requiring a Pro license—it is available to all.
A Render Texture is a special kind of texture that is generated at
runtime using an independent camera. The view of the camera is output
to a texture buffer instead of directly to the screen. This image can then
be placed anywhere within a 3D scene to display the camera's output.
This is normally used for minimaps (where the map is rendered in view
of a different camera) for rearview displays or circumstances where you
want to show an additional view other than what the Main Camera is
displaying. In one case, I saw a Render Texture being used in a Portal
( http://en.wikipedia.org/wiki/Portal_(video_game) )
clone, where one portal showed the view from another portal, in other
words, the place where the port came out, which was obviously not
what the player was looking at.
The big thing about Render Textures (as stated previously) is that it
requires a Unity Pro license (for each platform) for it to be used, putting
it just out of reach of users using the free license of Unity.
 
Search WWH ::




Custom Search