4 # Create an 8x8 texture with four miplevels, colored red, green, blue, and
5 # white, respectively. Draw the following:
8 # (integer LODs) (fractional w/ linear) (fractional w/ nearest)
11 # [2.2] [2.4] [2.6] [2.8] [2.2] [2.4] [2.6] [2.8]
14 # [1.2] [1.4] [1.6] [1.8] [1.2] [1.4] [1.6] [1.8]
18 # [0.2] [0.4] [0.6] [0.8] [0.2] [0.4] [0.6] [0.8]
24 # This verifies that textureLod() takes lod bias into account when
25 # selecting the proper miplevel for integer LODs (left boxes) and that
26 # both linear and nearest filtering for fractional LODs work
29 # Instead of seeing red, green, blue, and white squares, we should see
30 # only green, blue, white, and again white squares.
32 # It does not verify anything regarding texture coordinates.
39 uniform sampler2D tex;
43 gl_FragColor = textureLod(tex, vec2(0.5, 0.5), lod);
50 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
55 clear color 0.4 0.4 0.4 0.4
61 # Draw the miptree: basic integer LODs.
63 texparameter 2D lod_bias 1.0
64 texparameter 2D min nearest_mipmap_nearest
65 texparameter 2D mag nearest
79 # Fractional LODs: nearest filtering between miplevels
82 draw rect 152 42 10 10
85 draw rect 167 42 10 10
88 draw rect 182 42 10 10
91 draw rect 197 42 10 10
94 draw rect 152 68 10 10
97 draw rect 167 68 10 10
100 draw rect 182 68 10 10
102 uniform float lod 1.8
103 draw rect 197 68 10 10
105 uniform float lod 2.2
106 draw rect 152 86 10 10
108 uniform float lod 2.4
109 draw rect 167 86 10 10
111 uniform float lod 2.6
112 draw rect 182 86 10 10
114 uniform float lod 2.8
115 draw rect 197 86 10 10
118 # Fractional LODs: linear filtering between miplevels
120 texparameter 2D min nearest_mipmap_linear
122 uniform float lod 0.2
123 draw rect 52 42 10 10
125 uniform float lod 0.4
126 draw rect 67 42 10 10
128 uniform float lod 0.6
129 draw rect 82 42 10 10
131 uniform float lod 0.8
132 draw rect 97 42 10 10
134 uniform float lod 1.2
135 draw rect 52 68 10 10
137 uniform float lod 1.4
138 draw rect 67 68 10 10
140 uniform float lod 1.6
141 draw rect 82 68 10 10
143 uniform float lod 1.8
144 draw rect 97 68 10 10
146 uniform float lod 2.2
147 draw rect 52 86 10 10
149 uniform float lod 2.4
150 draw rect 67 86 10 10
152 uniform float lod 2.6
153 draw rect 82 86 10 10
155 uniform float lod 2.8
156 draw rect 97 86 10 10
158 # Probes: integer LODs
159 probe rgb 26 15 0.0 1.0 0.0
160 probe rgb 18 57 0.0 0.0 1.0
161 probe rgb 14 83 1.0 1.0 1.0
162 probe rgb 12 98 1.0 1.0 1.0
164 # Probes: nearest filtering
165 probe rgb 157 47 0.0 1.0 0.0
166 probe rgb 172 47 0.0 1.0 0.0
167 probe rgb 189 47 0.0 0.0 1.0
168 probe rgb 202 47 0.0 0.0 1.0
170 probe rgb 157 73 0.0 0.0 1.0
171 probe rgb 172 73 0.0 0.0 1.0
172 probe rgb 189 73 1.0 1.0 1.0
173 probe rgb 202 73 1.0 1.0 1.0
175 probe rgb 157 91 1.0 1.0 1.0
176 probe rgb 172 91 1.0 1.0 1.0
177 probe rgb 189 91 1.0 1.0 1.0
178 probe rgb 202 91 1.0 1.0 1.0
180 # Probes: linear filtering (tolerance of 0.05 makes it pass on fglrx)
181 tolerance 0.05 0.05 0.05 0.05
183 probe rgb 57 47 0.0 0.8 0.2
184 probe rgb 72 47 0.0 0.6 0.4
185 probe rgb 89 47 0.0 0.4 0.6
186 probe rgb 102 47 0.0 0.2 0.8
188 probe rgb 57 73 0.2 0.2 1.0
189 probe rgb 72 73 0.4 0.4 1.0
190 probe rgb 89 73 0.6 0.6 1.0
191 probe rgb 102 73 0.8 0.8 1.0
193 probe rgb 57 91 1.0 1.0 1.0
194 probe rgb 72 91 1.0 1.0 1.0
195 probe rgb 89 91 1.0 1.0 1.0
196 probe rgb 102 91 1.0 1.0 1.0