首页 > 代码库 > Camera & Render
Camera & Render
1、void Render();
Description
Render the camera manually.
This will render the camera. It will use the camera‘s clear flags, target texture and all other settings.
The camera will send OnPreCull, OnPreRender & OnPostRender to any scripts attached, and render any eventual image filters.
2、void CopyFrom(Camera other);
Makes this camera‘s settings match other camera.
other
camera. It will also set this camera‘s transform to match the other camera, as well as this camera‘s layer to match the layer of the other camera.The first enabled camera tagged "MainCamera" (Read Only).
null
if there is no such camera in the scene.Render the camera with shader replacement.
This will render the camera. It will use the camera‘s clear flags, target texture and all other settings.
The camera will not send OnPreCull, OnPreRender or OnPostRender to attached scripts. Image filters will not be rendered either.
This is used for special effects, e.g. rendering screenspace normal buffer of the whole scene, heat vision and so on. To make use of this feature, usually you create a camera and disable it. Then call RenderWithShader on it.
You are not able to call the Render function from a camera that is currently rendering. If you wish to do this create a copy of the camera, and make it match the original one using CopyFrom.
Remove shader replacement from camera.
Make the camera render with shader replacement.
After calling this function, camera will render its view with shader replacement. Call ResetReplacementShader to reset it back to normal rendering.
Camera & Render