Camera.RenderToCubemapfunction RenderToCubemap (cubemap : Cubemap, faceMask : int = 63) : booleanDescriptionRender into a cubemap from this camera. This is mostly useful in the editor for "baking" static cubemaps of your scene. See wizard example below. Camera's position, clear flags and clipping plane distances will be used to render into cubemap faces. faceMask is a bitfield indicating which cubemap faces should be rendered into. Each bit that is set corresponds to a face. Bit numbers are integer values of CubemapFace enum. By default all six cubemap faces will be rendered (default value 63 has six lowest bits on). This function will return false if rendering to cubemap fails. Some graphics hardware does not support the functionality. Note: This is a Unity PRO feature. See Also: Cubemap assets, Reflective shaders. // Render scene from a given point into a static cube map. function RenderToCubemap (cubemap : RenderTexture, faceMask : int = 63) : booleanDescriptionRender into a cubemap from this camera. This is used for real-time reflections into cubemap render textures. It can be quite expensive though, especially if all six cubemap faces are rendered each frame. Camera's position, clear flags and clipping plane distances will be used to render into cubemap faces. faceMask is a bitfield indicating which cubemap faces should be rendered into. Each bit that is set corresponds to a face. Bit numbers are integer values of CubemapFace enum. By default all six cubemap faces will be rendered (default value 63 has six lowest bits on). This function will return false if rendering to cubemap fails. Some graphics hardware does not support the functionality. Note: This is a Unity PRO feature. See Also: RenderTexture.isCubemap, Reflective shaders. // Attach this script to an object that uses a Reflective shader. |
