I'm developing for movil VR so performances in mandatory here.
It is written in every good practice for VR to avoid unity's skybox and use skydomes instead. I created a dome in blender with its texture and it all.
I import the dome as fbx, apply a Mobile/Unlit shader and the texture image, it looks great.
My problem is that when running the game the dome gets out of the far clipping plane. Options:
- Set bigger far clipping plane, it leads plenty of stuff I'd like to clip .. not being clipped.
- Set some kind of two pass render, I did not even try, the overhead sounds awful.
- Set high far clipping plane, and then setting the culling per layer lower for everything else, that works but leads to resolution problem since the "action" actually happens close to the player.
I did not test but I'm pretty sure for a dome in VR we can go with a single render as background, same for both eyes (since it is in the infinite and should not parallax.
I did as sugested, added a second camera, Clear Flags: Depth only
, culling mask only DomeLayer
and actually moved the camera to the DomeLayer
Main Camera (from googleVR demo scene) is set to Clear Flags: Don't clear
, culling mask to Everything but DomeLayer
And it kind of works but
There is a de-synchronization between both cameras.
Notice the angle of the small first cone (main camera) and the direction of the bigger outer cone (dome camera), btw I cannot set the camera as child of the Left or Right cameras because they don't exists before I start the game.
The overhead when switching second camera on is kind of impressive..
I switched off the dome camera, let it run for a while and switch it back on, notice the SetPass and any other metrics. The impact of the second camera is ugly..
I am running in a notebook that has no dedicated graphics card but still, the overhead is there and the thing is meant to run on a mobile device ..
Am I doing something wrong ?