- Home /
Question by
Marnix · Apr 10, 2011 at 04:22 PM ·
rendertextureguitexturecubemap
Preview cubemap rendertexture on screen
I know how to make a cubemap with a RenderTexture, but how can I set this cubemapped RenderTexture as a GUI image to preview it in my game?
Normal GUI images work, but this cubemap doesn't show. Only a white rectangle is shown.
Comment
Are you using Unity Pro? RenderTexture only works there.
@fireDude67: Yes, but the problem is that a cubemap is not just a texture. So putting it as a GUI-texture doesn't work to just preview it. Normal RenderTextures can be displayed. I've already accomplished that, but not with a cubemap texture.
@$$anonymous$$arnix I just wanted to see if you did. Otherwise, I knew what you were talking about.
Answer by fireDude67 · Jun 16, 2011 at 07:02 PM
Try casting:
public RenderTexture cubeMap; // Assign through inspector
public GUITexture blank; // Assign a blank GUITexture here
Texture2D drawTexture = (Texture2D)cubemap;
void Start() { blank.texture = drawTexture; }