Forum Discussion
LucaMefisto
10 years agoMeta Employee
Change FOV
Hi!
Befor e(Unity 5.1) I was able to change the FOV of a camera on precull and restore it on preRender. But now on 5.3 it does not seem to make effect.
For me it was a cheap and fast way to cull a lot of things, since the player is wearing a diving helmet that allows him to barely see the outside world with a FOV of 70.
Changint the Camera Rect seems to be unavailable as well... any clues on this?
Befor e(Unity 5.1) I was able to change the FOV of a camera on precull and restore it on preRender. But now on 5.3 it does not seem to make effect.
For me it was a cheap and fast way to cull a lot of things, since the player is wearing a diving helmet that allows him to barely see the outside world with a FOV of 70.
Changint the Camera Rect seems to be unavailable as well... any clues on this?
7 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffFOV is read-only in VR because changing it would cause discomfort. How were you doing the culling? You should be able to add a collider and renderer for the helmet that will properly occlude the non-visible content.
- LucaMefistoMeta Employee
"vrdaveb" wrote:
FOV is read-only in VR because changing it would cause discomfort. How were you doing the culling? You should be able to add a collider and renderer for the helmet that will properly occlude the non-visible content.
I was basically setting the FOV to 70 OnPreCull and then put it back to normal on OnPreRender. I never noticed anything anything bad in the rendering, appart from not having to render those elements when off the bounds of the helmet, obviously.
No low-level way of doing this? - vrdavebOculus StaffEven if you leave the FOV alone, Unity's occlusion culling should be eliminating the invisible objects. Is that not the case? Are you seeing more draw calls in 5.3 compared to 5.1?
- LucaMefistoMeta EmployeeThanks for your help vrdaved
After closer investigation I realized a very simple mistake: the 5.1 fov optimization was done and tested in a laptop that never had the Oculus rift plugged, as soon as I do it my FOV changer does not work even in that old version.
Which is a pity because it does help reduce a lot the triangles without needing to do the overhead of occlusion culling. :(
So, no chances to get that working I assume, looks like something deep inside the unity side. - vrdavebOculus StaffSorry, this is the first time we've received a request for that feature. I'll see what we can do about it. In the meantime, you could potentially cull the invisible content in other ways. Have you tried something like this? http://answers.unity3d.com/questions/33 ... plane.html
- LucaMefistoMeta Employeethanks! I will give it a shot.
Yeah my case it's quite specific I guess so I imagine it's normal this is the first request. I will try to find my way around it for now I imagine!
Edit: I have found this http://forum.unity3d.com/threads/vr-fie ... ew.358816/ fix seems to be on its way? - LucaMefistoMeta EmployeeFrom that Unity post: http://forum.unity3d.com/threads/vr-fie ... ew.358816/
If I change the variable fieldOfView on precull it does change but only in the left eye (camera set to both). I guess this is an easy fix by separating the cameras... but somehow they get disabled?
Edit: I commented the code that disabled them... surprisingly enought this codeprivate Camera reducedCamera;
[Range (1,179)]
public float cullingFov = 40.0f;
private float renderingFov = 106;
private Rect renderingRect;
void Awake()
{
reducedCamera = this.GetComponent<Camera>();
renderingFov = reducedCamera.fieldOfView;
}
void OnPreCull()
{
reducedCamera.fieldOfView = cullingFov;
}
void OnPreRender()
{
reducedCamera.fieldOfView = 106.188f;
}
Does 2 thing wrong: first the OnPReRender section does not seem to be working (Testing using the DK2) because the rendering still looks like 40 FOV
Second reducing the FOV using this is actually increasing the number of triangles!?! Definetely weird!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 6 months ago
- 2 years ago