x


OpenGL Camera.RenderToCubemap fails

I'm basicly using this script http://unity3d.com/support/documentation/ScriptReference/Camera.RenderToCubemap.html in forced OpenGL mode, and the line cam.RenderToCubemap(rtex, faceMask) always returns false.

  • Does Camera.RenderToCubemap always fail in forced OpenGL mode on PC Standalones, or does that depend on the GPU?
more ▼

asked Mar 03 '11 at 08:16 AM

bziii gravatar image

bziii
26 1 1 8

Just to add, I'm using Forward rendering and everything works in normal DirectX mode - but I need to use forced OpenGL because I'm getting a texture from a native plugin.

Mar 03 '11 at 08:35 AM bziii

I am not aware of the differences between OpenGL and DirectX in regard to Unity, but maybe your native plugin have some odd texture format? Just a far shot.

Mar 03 '11 at 12:58 PM Statement ♦♦

Nope, straight OpenGL BGR 8bit per channel format. I don't think that's an odd format.

Mar 03 '11 at 02:39 PM bziii
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

The Camera.RenderToCubemap() in forced OpenGL is supported on some GPU's, depending on the model and the drivers.

So the correct usage would be to try rendering to a cubemap and if it fails (returns false), fallback to 6 camera shots using render targets and constructing a cubemap using Cubemap.SetPixels().

more ▼

answered Mar 06 '11 at 11:58 AM

bziii gravatar image

bziii
26 1 1 8

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

This function will return false if rendering to cubemap fails. Some graphics hardware does not support the functionality.

This is all information they provide (apart from you need Unity PRO). Do you have access to try this on other machines with other GPUs? It shouldn't be the hardware that fail since it works in DirectX (on the same machine?), possibly some driver/opengl issue. I hope someone sheds light on this for you.

more ▼

answered Mar 03 '11 at 01:16 PM

Statement gravatar image

Statement ♦♦
20.1k 35 70 175

I'm guessing it is a driver issue, will test on other machines.

Mar 03 '11 at 02:40 PM bziii
(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:

x2987
x168
x118
x112
x57

asked: Mar 03 '11 at 08:16 AM

Seen: 1292 times

Last Updated: Mar 06 '11 at 09:57 AM