Rendering to a cubemap: resolution limitation?

Greetings!

We are trying to render a scene to a cubemap, but beyond the 512 resolution, we get the following error message:

screenviewcoord[1] < 0 ||
screenviewcoord[3] < 0

UnityEngine.Camera:RenderToCubemap(Cubemap)

The offending code is:

using UnityEngine;
using System.Collections;

[RequireComponent (typeof (Camera))]
public class RenderCube: MonoBehaviour {
	Cubemap DynamicCube = null;
    
	void Start () {
	DynamicCube = new Cubemap(1024, TextureFormat.ARGB32, false);
	}

	void Update () {

		Debug.Log("Rendering to dynamic cubemap");
		gameObject.camera.RenderToCubemap(DynamicCube); 	
	}
}

Is there a built-in limitation on the resolution of a cubemap render?

Anyone could help us here?

Thanks!

So we finally got this thing working.

Here’s FYI:

Don’t create a cubemap, but use a RenderTexture instead. Rendering to it is MUCH faster.

Simply set the RenderTexture.isCubemap flag to true, and set the resolution to whatever NPOT resolution you fancy. I think 4096 is the maximum cubemap resolution.

Hope this helps!