- Home /
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?
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.
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.
Nope, straight OpenGL BGR 8bit per channel format. I don't think that's an odd format.
Answer by bziii · Mar 06, 2011 at 11:58 AM
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()
.
Answer by Statement · Mar 03, 2011 at 01:16 PM
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.
I'm guessing it is a driver issue, will test on other machines.