Camera & Render

來源:互聯網
上載者:User

標籤:

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.

  This is used for taking precise control of render order. To make use of this feature, create a camera and disable it. Then call Render 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.

2、void CopyFrom(Camera other);

Description

  Makes this camera‘s settings match other camera.

  This will copy all camera‘s variables (field of view, clear flags, culling mask, ...) from the  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.  3、static Camera main;Description

  The first enabled camera tagged "MainCamera" (Read Only).

  Returns  null if there is no such camera in the scene.  This can be useful if you want one camera to match the other camera‘s setup, when doing custom rendering effects. For example when usingRenderWithShader. 4、void RenderWithShader(Shader shader, string replacementTag);Description

  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. 5、ResetReplacementShader(): void;Description

  Remove shader replacement from camera.

  Call this to end the effect of setting SetReplacementShader. 6、SetReplacementShader(shader: Shader, replacementTag: string): void;Description

  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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.