1# [description] 2# Test texture(sampler2DShadow, vec3) with 3# - depth texture mode = alpha 4# - texture compare func = always 5 6[require] 7GLSL >= 1.30 8 9[vertex shader] 10#version 130 11out vec4 tex_coord; 12void main() { 13 gl_Position = gl_Vertex; 14 tex_coord = (gl_Vertex + 1.0) / 2.0; 15} 16 17[fragment shader] 18#version 130 19const float canary = 0.125; 20uniform sampler2DShadow tex; 21in vec4 tex_coord; 22void main() { 23 float s = texture(tex, tex_coord.xyy); 24 gl_FragColor = vec4(s, canary, canary, canary); 25} 26 27[test] 28uniform int tex 0 29texture shadow2D 0 (32, 32) 30texparameter 2D depth_mode alpha 31texparameter 2D compare_func always 32draw rect -1 -1 2 2 33 34# depth comparison pass 35relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125); 36relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125); 37 38# depth comparison fail 39relative probe rgba (0.1, 0.0) (1.0, 0.125, 0.125, 0.125); 40relative probe rgba (1.0, 0.9) (1.0, 0.125, 0.125, 0.125); 41