![]() This is often used to apply a per-eye clamping in Single-Pass Stereo rendering mode to avoid color bleeding between eyes.Īdditionally, the constant unity_StereoEyeIndex is exposed in Shaders, so eye-dependent calculations can be performed. This only occurs when UNITY_SINGLE_PASS_STEREO is defined, otherwise the texture coordinates are returned unmodified. This only occurs when UNITY_SINGLE_PASS_STEREO is defined, otherwise the texture coordinates are returned unaltered.ĭescription: Returns the uv clamped in the x value by the width and bias provided by sb. This is often used to apply a per-eye scale and bias only when in Single-Pass Stereo rendering mode.ĭescription: Returns the result of applying the current eye’s scale and bias to the texture coordinates in uv. ![]() Sb - A float4 containing a 2D scale and 2D bias to be applied to the UV, with scale in xy and bias in zw.ĭescription: Returns the result of applying the scale and bias in sb to the texture coordinates in uv. Either a float2 for a standard UV or a float4 for a packed pair of two UVs. Unit圜G.cginc also contains the following helper functions to assist with authoring stereoscopic Shaders: Property Authoring and modifying Shaders to support Single-Pass Stereo renderingĮxisting helper functions in Unit圜G.cginc support Single-Pass Stereo rendering transparently. However, custom-built Shaders and Shaders downloaded from the Asset Store may need to be modified (for example, screen space coordinates might need to be scaled and offset to access the appropriate half of the packed Render Texture). Unity’s built-in rendering features and Standard Assets are all compatible with this feature. In PlayerSettings, navigate to Other Settings, ensure the Virtual Reality Supported checkbox is ticked, then tick the Single-Pass Stereo Rendering checkbox underneath it. To enable this feature, open PlayerSettings (menu: Edit > Project Settings > Player). Single-Pass Stereo VR rendering Left-eye and right-eye images packed together Normal VR rendering Left-eye image on the left, right-eye image on the right The comparison images below show the difference between normal VR rendering and Single-Pass Stereo rendering. Without this feature, Unity renders the Scene twice: first to render the left-eye image, and then again for the right-eye image. It renders both eye images at the same time into one packed Render Texture, meaning that the whole Scene is only rendered once, and CPU processing time is significantly reduced. Single-Pass Stereo rendering is a feature for PC and Playstation 4 based VR apps.
0 Comments
Leave a Reply. |