-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Built-in Shaders to 2019.1.0f2
- Loading branch information
1 parent
803692b
commit df86bd3
Showing
52 changed files
with
1,725 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | ||
|
||
#ifndef GLSL_STEREO_EXTENSIONS_INCLUDED | ||
#define GLSL_STEREO_EXTENSIONS_INCLUDED | ||
|
||
#ifdef STEREO_MULTIVIEW_ON | ||
#extension GL_OVR_multiview2 : require | ||
#endif | ||
|
||
#ifdef STEREO_INSTANCING_ON | ||
#extension GL_NV_viewport_array2 : enable | ||
#extension GL_AMD_vertex_shader_layer : enable | ||
#extension GL_ARB_fragment_layer_viewport : enable | ||
#endif | ||
|
||
#endif // GLSL_STEREO_EXTENSIONS_INCLUDED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | ||
|
||
#ifndef GLSL_STEREO_SETUP_INCLUDED | ||
#define GLSL_STEREO_SETUP_INCLUDED | ||
|
||
#if defined(STEREO_MULTIVIEW_ON) || defined(STEREO_INSTANCING_ON) | ||
layout(std140) uniform UnityStereoGlobals { | ||
mat4 unity_StereoMatrixP[2]; | ||
mat4 unity_StereoMatrixV[2]; | ||
mat4 unity_StereoMatrixInvV[2]; | ||
mat4 unity_StereoMatrixVP[2]; | ||
mat4 unity_StereoCameraProjection[2]; | ||
mat4 unity_StereoCameraInvProjection[2]; | ||
mat4 unity_StereoWorldToCamera[2]; | ||
mat4 unity_StereoCameraToWorld[2]; | ||
vec3 unity_StereoWorldSpaceCameraPos[2]; | ||
vec4 unity_StereoScaleOffset[2]; | ||
}; | ||
layout(std140) uniform UnityStereoEyeIndices { | ||
vec4 unity_StereoEyeIndices[2]; | ||
}; | ||
#endif | ||
|
||
#ifdef VERTEX | ||
#ifdef STEREO_MULTIVIEW_ON | ||
layout(num_views = 2) in; | ||
#endif | ||
|
||
uniform int unity_StereoEyeIndex; | ||
|
||
int SetupStereoEyeIndex() | ||
{ | ||
int eyeIndex = unity_StereoEyeIndex; | ||
|
||
#if defined(STEREO_MULTIVIEW_ON) | ||
eyeIndex = int(unity_StereoEyeIndices[gl_ViewID_OVR].x); | ||
#elif defined(STEREO_INSTANCING_ON) | ||
eyeIndex = int(gl_InstanceID & 1); | ||
gl_Layer = eyeIndex; | ||
#endif | ||
|
||
return eyeIndex; | ||
} | ||
|
||
mat4 GetStereoMatrixVP(int eyeIndex) | ||
{ | ||
mat4 stereoVP = unity_MatrixVP; | ||
|
||
#if defined(STEREO_MULTIVIEW_ON) || defined(STEREO_INSTANCING_ON) | ||
stereoVP = unity_StereoMatrixVP[eyeIndex]; | ||
#endif | ||
|
||
return stereoVP; | ||
} | ||
#endif | ||
|
||
#endif // GLSL_STEREO_SETUP_INCLUDED |
Oops, something went wrong.