Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

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

ReflectionProbe.IsFinishedRendering

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.

Close

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.

Close

Cancel

Switch to Manual
public function IsFinishedRendering(renderId: int): bool;
public bool IsFinishedRendering(int renderId);

Parameters

renderId An integer representing the RenderID as returned by the RenderProbe method.

Returns

bool True if the render has finished, false otherwise.

See Also: timeSlicingMode

Description

Checks if a probe has finished a time-sliced render.

#pragma strict
public class UpdateProbeEvery2Seconds extends MonoBehaviour {
	private var RenderId: int = -1;
	private var TheProbe: ReflectionProbe;
	public var TargetTexture: RenderTexture;
	function Start() {
		TheProbe = GetComponent.<ReflectionProbe>();
		// set the probe to render in time-slicing mode and make sure all faces of the cubemap render the same frame.
		TheProbe.timeSlicingMode = UnityEngine.Rendering.ReflectionProbeTimeSlicingMode.AllFacesAtOnce;
		while ( true ) {
			new WaitForSeconds(2.0f)// render the probe over several frames and blit into TargetTexture once finished.
			RenderId = TheProbe.RenderProbe(TargetTexture);
		}
	}
	function Update() {
		if (TheProbe.IsFinishedRendering(RenderId)) {
			// Probe has finished rendering, do something with the render texture
		}
	}
}
using UnityEngine;
using System.Collections;

public class UpdateProbeEvery2Seconds : MonoBehaviour { private int RenderId = -1; private ReflectionProbe TheProbe; public RenderTexture TargetTexture;

IEnumerator Start() { TheProbe = GetComponent<ReflectionProbe>();

// set the probe to render in time-slicing mode and make sure all faces of the cubemap render the same frame. TheProbe.timeSlicingMode = UnityEngine.Rendering.ReflectionProbeTimeSlicingMode.AllFacesAtOnce; while (true) { yield return new WaitForSeconds(2.0f);

// render the probe over several frames and blit into TargetTexture once finished. RenderId = TheProbe.RenderProbe(TargetTexture); } }

void Update() { if (TheProbe.IsFinishedRendering(RenderId)) { // Probe has finished rendering, do something with the render texture } } }

Did you find this page useful? Please give it a rating: