mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +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:
@@ -230,6 +230,17 @@ float Texture::getMipmapSharpness() const
|
||||
return mipmapSharpness;
|
||||
}
|
||||
|
||||
void Texture::setDepthSampleMode(Optional<CompareMode> mode)
|
||||
{
|
||||
if (mode.hasValue && (!readable || !isPixelFormatDepthStencil(format)))
|
||||
throw love::Exception("Only readable depth textures can have a depth sample compare mode.");
|
||||
}
|
||||
|
||||
Optional<CompareMode> Texture::getDepthSampleMode() const
|
||||
{
|
||||
return depthCompareMode;
|
||||
}
|
||||
|
||||
Quad *Texture::getQuad() const
|
||||
{
|
||||
return quad;
|
||||
|
||||
Reference in New Issue
Block a user