Add Depth compare / shadow sampler support. Officially this is only supported in glsl3 shaders.

- Add Texture:setDepthSampleMode(comparemode). Only works on textures with depth pixel formats. A texture with the depth sample mode set will only work with a depth sampler.
- Add DepthImage, DepthArrayImage, and DepthCubeImage sampler keywords to glsl3.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-04-12 20:26:06 -03:00
parent 0001b4695e
commit a0ef2ac28b
25 changed files with 444 additions and 151 deletions
+10
View File
@@ -50,6 +50,11 @@ GLSL.SYNTAX = [[
#define ArrayImage sampler2DArray
#define CubeImage samplerCube
#define VolumeImage sampler3D
#if __VERSION__ >= 300 && !defined(LOVE_GLSL1_ON_GLSL3)
#define DepthImage sampler2DShadow
#define DepthArrayImage sampler2DArrayShadow
#define DepthCubeImage samplerCubeShadow
#endif
#define extern uniform
#ifdef GL_EXT_texture_array
#extension GL_EXT_texture_array : enable
@@ -78,6 +83,11 @@ GLSL.FUNCTIONS = [[
#if __VERSION__ >= 300 || defined(GL_OES_texture_3D)
precision lowp sampler3D;
#endif
#if __VERSION__ >= 300
precision lowp sampler2DShadow;
precision lowp samplerCubeShadow;
precision lowp sampler2DArrayShadow;
#endif
#endif
#if __VERSION__ >= 130 && !defined(LOVE_GLSL1_ON_GLSL3)