- Home /
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!
Answer by GeeEll · Mar 08, 2012 at 12:13 AM
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!
Your answer
Follow this Question
Related Questions
How to get viewport setup resolution 0 Answers
forcing texture resolution? 1 Answer
Can I create a 64x64 resolution 3D game in Unity? 2 Answers
Why do I see this fog in the mittle of my view on my skybox cubemap? 1 Answer
Is there a setting to default the Editor Game View to a specific aspect ratio? 2 Answers