- Home /
RenderTexutre to Skybox
I have a render texture that is 6 times longer than it is high, and has a valid layout for a cubemap to use in a skybox. But it's a render texture and Unity will not allow me to use that texture as a cubemap for some reason that doesn't really make any sense since it is valid. Gives me the error:
RenderTexture.Create failed: cube maps must be power of two and width must match height.
So I am stuck. I can export the render texture by converting it to a Texture2D and then re-importing the PNG and setting that up as a cubemap with no problems. I would do this to solve my problem, if I didn't want the possibility of everything to be rendered in real time, and that it takes a very long time to do the conversion from rendertexture to texture2D.
So is there anyway that I can take my rendertexture the way it is, and use it as a cubemap straight from my script?
I got the same problem, really expecting someone give us a good answer
Sorry, I know this is an old question but did you ever find a solution? I'm about to attempt a very similar process.
Answer by helarts · Nov 04, 2015 at 03:53 PM
You could try ( http://docs.unity3d.ru/ScriptReference/RenderTexture-isPowerOfTwo.html )
myRT.isPowerOfTwo = true;
Also in unity's doc for RenderTexture.isCubemap: "A cubemap render texture must have the same width and height" ( http://docs.unity3d.com/ScriptReference/RenderTexture-isCubemap.html )
Already tried. The render texture I am using is a 1aX6a where a is the resolution of each side of the skybox.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Using Render Textures To Create a Cubemap 0 Answers
What is an element in CopyTexture ? 1 Answer
Multiple Cars not working 1 Answer
Rendertexture to texture2d in Unity5 0 Answers