Render to cubemap

Hey,

I am currently working on a big scene in which I have my player walking around. As it’s for mobile and I need to save performance I have a shader on my player that uses a cube map for reflection. So as the scene is getting bigger I was thinking about switching the cube maps based on certain areas. So I’d probably use this Camera.RenderToCubemap. As I already have a long loading time, I can’t render all cube maps at the beginning, which made me think to render the cube map on realtime each time the player changes the area. But on the other hand this would probably be a peak in the performance needed and if so it might crash the game. I don’t have Unity pro so I can’t just try it out and check on the profiler if it works :frowning:

Does anybody have any experience with calculating realtime cube maps?

As far as I know you won’t be able to do so without pro anyway because the free version does not support render textures. But you can still do different cubemaps and assign them when the player switches those areas via triggers for example.

Well my problem is that I already have 30 seconds of loading time. If I need to load another 20 cubemaps it will eat up a lot of memory and it will load even longer.

A possibility I was thinking about was loading the cube maps from the resources folder but I have no idea what command to use from there.
Another thing was creating the different materials at the beginning but that was way too much work.

The easiest way (and probably the only one) right now is to prepare those cubemaps yourself and assign the one needed to the players material via code and triggers.

And I’ve never used the resources folder, but I don’t think that would make any difference to the loading time. Because the data has to be loaded anyway just like any other asset in any other folder. Correct me if I’m wrong.

As far as I know usually all data is loaded at the beginning of the scene. But when you put something in the asset folder then you can access the asset folder during runtime and load additional content from that folder. Content that wasn’t loaded earlier and as such didn’t affect the loading time.
I’m using that for Gameobjects and it works fine for that, but I think it wasn’t considered for loading cube maps.

The other thing I was thinking about was using Application.LoadLevelAdditivASync but it is also a Unity Pro Only feature. I know there is Application.LoadLevelAdditiv but it makes the scene bumpy as it waits until the object is loaded