Difference between revisions of "Texture:setDepthSampleMode"

(Created page)
 
m (0.11.0 -> 11.0)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
 
Sets the comparison mode used when sampling from a [[PixelFormat|depth texture]] in a shader.
 
Sets the comparison mode used when sampling from a [[PixelFormat|depth texture]] in a shader.
  
Line 14: Line 14:
 
=== Arguments ===
 
=== Arguments ===
 
{{param|CompareMode|compare|The comparison mode used when sampling from this texture in a shader.}}
 
{{param|CompareMode|compare|The comparison mode used when sampling from this texture in a shader.}}
 +
=== Returns ===
 +
Nothing.
 +
== Function ==
 +
Disables depth texture comparison functionality for this texture.
 +
=== Synopsis ===
 +
<source lang="lua">
 +
Texture:setDepthSampleMode( )
 +
</source>
 +
=== Arguments ===
 +
None.
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.

Latest revision as of 18:35, 7 May 2019

Available since LÖVE 11.0
This function is not supported in earlier versions.

Sets the comparison mode used when sampling from a depth texture in a shader.

Depth texture comparison modes are advanced low-level functionality typically used with shadow mapping in 3D.

When using a depth texture with a comparison mode set in a shader, it must be declared as a sampler2DShadow and used in a GLSL 3 Shader. The result of accessing the texture in the shader will return a float between 0 and 1, proportional to the number of samples (up to 4 samples will be used if bilinear filtering is enabled) that passed the test set by the comparison operation.

Depth texture comparison can only be used with readable depth-formatted Canvases.

Function

Synopsis

Texture:setDepthSampleMode( compare )

Arguments

CompareMode compare
The comparison mode used when sampling from this texture in a shader.

Returns

Nothing.

Function

Disables depth texture comparison functionality for this texture.

Synopsis

Texture:setDepthSampleMode( )

Arguments

None.

Returns

Nothing.

See Also

Other Languages