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() selects the proper miplevel for integer
25 # LODs (left boxes) and that both linear and nearest filtering for fractional
26 # LODs work correctly.
28 # It does not verify anything regarding texture coordinates.
35 uniform sampler2D tex;
39 gl_FragColor = textureLod(tex, vec2(0.5, 0.5), lod);
46 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
51 clear color 0.4 0.4 0.4 0.4
57 # Draw the miptree: basic integer LODs.
59 texparameter 2D min nearest_mipmap_nearest
60 texparameter 2D mag nearest
74 # Fractional LODs: nearest filtering between miplevels
77 draw rect 152 42 10 10
80 draw rect 167 42 10 10
83 draw rect 182 42 10 10
86 draw rect 197 42 10 10
89 draw rect 152 68 10 10
92 draw rect 167 68 10 10
95 draw rect 182 68 10 10
98 draw rect 197 68 10 10
100 uniform float lod 2.2
101 draw rect 152 86 10 10
103 uniform float lod 2.4
104 draw rect 167 86 10 10
106 uniform float lod 2.6
107 draw rect 182 86 10 10
109 uniform float lod 2.8
110 draw rect 197 86 10 10
113 # Fractional LODs: linear filtering between miplevels
115 texparameter 2D min nearest_mipmap_linear
117 uniform float lod 0.2
118 draw rect 52 42 10 10
120 uniform float lod 0.4
121 draw rect 67 42 10 10
123 uniform float lod 0.6
124 draw rect 82 42 10 10
126 uniform float lod 0.8
127 draw rect 97 42 10 10
129 uniform float lod 1.2
130 draw rect 52 68 10 10
132 uniform float lod 1.4
133 draw rect 67 68 10 10
135 uniform float lod 1.6
136 draw rect 82 68 10 10
138 uniform float lod 1.8
139 draw rect 97 68 10 10
141 uniform float lod 2.2
142 draw rect 52 86 10 10
144 uniform float lod 2.4
145 draw rect 67 86 10 10
147 uniform float lod 2.6
148 draw rect 82 86 10 10
150 uniform float lod 2.8
151 draw rect 97 86 10 10
153 # Probes: integer LODs
154 probe rgb 26 15 1.0 0.0 0.0
155 probe rgb 18 57 0.0 1.0 0.0
156 probe rgb 14 83 0.0 0.0 1.0
157 probe rgb 12 98 1.0 1.0 1.0
159 # Probes: nearest filtering
160 probe rgb 157 47 1.0 0.0 0.0
161 probe rgb 172 47 1.0 0.0 0.0
162 probe rgb 189 47 0.0 1.0 0.0
163 probe rgb 202 47 0.0 1.0 0.0
165 probe rgb 157 73 0.0 1.0 0.0
166 probe rgb 172 73 0.0 1.0 0.0
167 probe rgb 189 73 0.0 0.0 1.0
168 probe rgb 202 73 0.0 0.0 1.0
170 probe rgb 157 91 0.0 0.0 1.0
171 probe rgb 172 91 0.0 0.0 1.0
172 probe rgb 189 91 1.0 1.0 1.0
173 probe rgb 202 91 1.0 1.0 1.0
175 # Probes: linear filtering (tolerance of 0.05 makes it pass on fglrx)
176 tolerance 0.05 0.05 0.05 0.05
178 probe rgb 57 47 0.8 0.2 0.0
179 probe rgb 72 47 0.6 0.4 0.0
180 probe rgb 89 47 0.4 0.6 0.0
181 probe rgb 102 47 0.2 0.8 0.0
183 probe rgb 57 73 0.0 0.8 0.2
184 probe rgb 72 73 0.0 0.6 0.4
185 probe rgb 89 73 0.0 0.4 0.6
186 probe rgb 102 73 0.0 0.2 0.8
188 probe rgb 57 91 0.2 0.2 1.0
189 probe rgb 72 91 0.4 0.4 1.0
190 probe rgb 89 91 0.6 0.6 1.0
191 probe rgb 102 91 0.8 0.8 1.0