mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +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:
@@ -125,6 +125,12 @@ bool isPixelFormatDepthStencil(PixelFormat format)
|
||||
return iformat >= (int) PIXELFORMAT_STENCIL8 && iformat <= (int) PIXELFORMAT_DEPTH32F_STENCIL8;
|
||||
}
|
||||
|
||||
bool isPixelFormatDepth(PixelFormat format)
|
||||
{
|
||||
int iformat = (int) format;
|
||||
return iformat >= (int) PIXELFORMAT_DEPTH16 && iformat <= (int) PIXELFORMAT_DEPTH32F_STENCIL8;
|
||||
}
|
||||
|
||||
size_t getPixelFormatSize(PixelFormat format)
|
||||
{
|
||||
switch (format)
|
||||
|
||||
Reference in New Issue
Block a user