x


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!

more ▼

asked Aug 03 '11 at 07:02 PM

GeeEll gravatar image

GeeEll
16 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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!

more ▼

answered Mar 08 '12 at 12:13 AM

GeeEll gravatar image

GeeEll
16 1 1 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x378
x265
x74
x57

asked: Aug 03 '11 at 07:02 PM

Seen: 890 times

Last Updated: Mar 08 '12 at 12:13 AM