[0.4.3+] Changing MSAA at runtime?
Right now, if I change QualitySettings.antiAliasing at runtime, nothing happens. If I make small modifications to OVRDisplay.cs to allow reconfiguring the eye textures by releasing the existing rendertextures and then creating them as usual via ConfigureEyeTexture(), I get a black screen and no errors to look at.
Is there a recommended approach to accomplishing this? Any help is appreciated!
----
Details of what I tried:
New method added to OVRDisplay.cs (logic taken from bottom of OVRDisplay()):
Calling new method at bottom of OVRDisplay() in place of the old logic:
In ConfigureEyeTexture(), inserted the following just prior to newing up the RenderTextures:
A test script to try cycling MSAA:
Is there a recommended approach to accomplishing this? Any help is appreciated!
----
Details of what I tried:
New method added to OVRDisplay.cs (logic taken from bottom of OVRDisplay()):
public void ReconfigureEyeTextures()
{
for (int i = 0; i < eyeTextureCount; i += 2)
{
ConfigureEyeTexture(i, OVREye.Left, OVRManager.instance.nativeTextureScale);
ConfigureEyeTexture(i, OVREye.Right, OVRManager.instance.nativeTextureScale);
}
}
Calling new method at bottom of OVRDisplay() in place of the old logic:
ReconfigureEyeTextures();
}
In ConfigureEyeTexture(), inserted the following just prior to newing up the RenderTextures:
if(eyeTextures[eyeIndex] != null)
{
eyeTextures[eyeIndex].Release();
eyeTextures[eyeIndex] = null;
}
A test script to try cycling MSAA:
if(Input.GetKeyDown(KeyCode.J))
{
if(QualitySettings.antiAliasing == 0)
QualitySettings.antiAliasing = 2;
else if(QualitySettings.antiAliasing == 2)
QualitySettings.antiAliasing = 4;
else if(QualitySettings.antiAliasing == 4)
QualitySettings.antiAliasing = 0;
if(OVRManager.display != null)
OVRManager.display.ReconfigureEyeTextures();
Debug.Log("QualitySettings.antiAliasing = " + QualitySettings.antiAliasing.ToString());
}
