How To Generate The Environment Cubemap In Unity

Follow this tutorial if you want to apply surrounding environment reflections to your object.

This page contains affiliate links. If you purchase a product or a service through one of them, I will receive a small commission (at no additional cost to you). I only recommend products or services that I have personally used and benefitted from personally. Thank you for your support!

Tutorial requirements

  • Unity 5 or newer

Downloads / Resources

Watch tutorial

Tutorial steps

Okay, so I have made this simple Environment in Unity.

To create a Cubemap (to capture your Environment into a Cubemap) you need to download this Script! After you download it, create the Editor folder anywhere in your Project tab and put a RenderCubemapWizard.cs inside that Editor folder.

Create an Empty GameObject in the Scene.

I called it Render Position (you can call it whatever you want). Changed it’s position to the center of my Environment. This will be the Cubemap capture position.

Create a Cubemap. Inside Project tab press RMB, select Create > Legacy > Cubemap.

It will create this grey Cubemap without any textures applied. I called it Cubemap_01 (you can call it whatever you want).

Select Cubemap_01 and enable Readable (Very importatnt)! This will allow the scripts to access the pixel data of the cubemap. I also changed Face Size to 512 (Width and Height of each Cubemap face in pixels. The textures will be scaled automatically to fit this size).

Now go to GameObject > Render into Cubemap

This window will pop up

Add Render Position (Empty GameObject we just created inside the Scene) to Render From Position. And inside the Cubemap slot add Cubemap_01 (Cubemap we just created inside Project tab).

Now we have a nice Cubemap created.

Thank you for stopping by! :)

If you want to support me, you can do that by subscribing to my YouTube channel or by buying my Game Assets. This helps me to create more content for you guys! Appreciate any support :)

Share This Tutorial
Comments

Recent Posts

Be The First to Know

Join LMHPOLY newsletter and get all the news straight to your inbox: game assets, tutorials, videos, blog posts, products, product updates, and FREE stuff.

I respect your privacy.