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
+3
View File
@@ -28,6 +28,7 @@
#include "graphics/Color.h"
#include "graphics/Texture.h"
#include "graphics/vertex.h"
#include "graphics/depthstencil.h"
#include "common/Matrix.h"
// GLAD
@@ -326,6 +327,7 @@ public:
bool isClampZeroTextureWrapSupported() const;
bool isPixelShaderHighpSupported() const;
bool isInstancingSupported() const;
bool isDepthCompareSampleSupported() const;
/**
* Returns the maximum supported width or height of a texture.
@@ -379,6 +381,7 @@ public:
static GLenum getGLBufferUsage(vertex::Usage usage);
static GLenum getGLTextureType(TextureType type);
static GLint getGLWrapMode(Texture::WrapMode wmode);
static GLint getGLCompareMode(CompareMode mode);
static TextureFormat convertPixelFormat(PixelFormat pixelformat, bool renderbuffer, bool &isSRGB);
static bool isTexStorageSupported();