Version: 5.3 (switch to 5.4b)
언어English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

MonoBehaviour.OnRenderImage(RenderTexture,RenderTexture)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

닫기

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

닫기

취소

Switch to Manual

Description

모든 렌더링이 완료된 후에 렌더 이미지로 OnRenderImage가 호출됩니다.

포스트프로세싱 효과.

쉐이더 기반의 필터로 처리하여 최종 이미지를 변경할 수 있습니다. incoming 이미지는 source 렌더텍스쳐입니다. 결과로는 destination render texture. You must always issue a Graphics.Blit() or render a fullscreen quad if your override this method.

destination 렌더텍스쳐가 되어야 합니다. 여러개의 이미지 필터들이 카메라로 어태치될 때, 첫번째 필터의 source에서 next 필터로 destination 전달에 의해 순차적으로 이미지를 처리합니다.

이 메시지는 카메라에 첨부된 모든 스크립트로 전달됩니다.

See Also: Writing Image Effects.

	var mat: Material;

function OnRenderImage(src: RenderTexture, dest: RenderTexture) { // Copy the source Render Texture to the destination, // applying the material along the way. Graphics.Blit(src, dest, mat); }
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Material mat; void OnRenderImage(RenderTexture src, RenderTexture dest) { Graphics.Blit(src, dest, mat); } }