mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user