Fixed quad height
This commit is contained in:
parent
f6fd5798b2
commit
57c9a8f643
@ -3183,8 +3183,8 @@ MonoBehaviour:
|
|||||||
renderQuad: {fileID: 2080936950}
|
renderQuad: {fileID: 2080936950}
|
||||||
material: {fileID: 0}
|
material: {fileID: 0}
|
||||||
layer: 9
|
layer: 9
|
||||||
tabWidth: 0.05
|
tabWidth: 0.2
|
||||||
quadOffset: 0.87
|
quadOffset: 1
|
||||||
--- !u!1 &1385339222
|
--- !u!1 &1385339222
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -148,7 +148,7 @@ struct WorldInfo {
|
|||||||
if (usingTexture)
|
if (usingTexture)
|
||||||
camera.targetTexture = null;
|
camera.targetTexture = null;
|
||||||
|
|
||||||
float height = 2f * Mathf.Atan(Mathf.Deg2Rad * camera.fieldOfView) * quadOffset;
|
float height = 2f * Mathf.Tan(Mathf.Deg2Rad * camera.fieldOfView / 2f) * quadOffset;
|
||||||
renderQuad.localScale = new Vector3(camera.aspect * height, height, 1f);
|
renderQuad.localScale = new Vector3(camera.aspect * height, height, 1f);
|
||||||
texture = new RenderTexture(Screen.width, Screen.height, 32);
|
texture = new RenderTexture(Screen.width, Screen.height, 32);
|
||||||
material.SetTexture(CameraTexture, texture);
|
material.SetTexture(CameraTexture, texture);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user