-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SSAO on OpenGL platforms [closes #21]
- Loading branch information
Showing
4 changed files
with
47 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using UnityEngine; | ||
using UnityEngine.Rendering; | ||
|
||
namespace ToonRP.Runtime | ||
{ | ||
public static class GraphicsApiUtils | ||
{ | ||
// OpenGL uses the [-1, 1] depth clip space. | ||
// Other APIs use the [0, 1] range. | ||
public static bool OpenGlStyleClipDepth | ||
{ | ||
get | ||
{ | ||
#if UNITY_WEBGL | ||
return true; | ||
#else // !UNITY_WEBGL | ||
GraphicsDeviceType api = SystemInfo.graphicsDeviceType; | ||
return api is | ||
GraphicsDeviceType.OpenGLCore or | ||
GraphicsDeviceType.OpenGLES2 or | ||
GraphicsDeviceType.OpenGLES3; | ||
#endif // UNITY_WEBGL | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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